NLTK ImportError: DLL load failed: The specified module could not be found

thelaw

I am working on a project in pycharm. I am trying to import nltk to my project like this. I have tried installing it through many different ways and they all lead to the same outcome. The error shown in the end.

I tried installing it through the lightbulb on pycharm, I tried installing the module through the project settings, I tried installing nltk through conda -install nltk. I don't understand why I get this error. Can someone shed some light. Thank you in advance!

import nltk    
nltk.download()

C:\Users\Orestis\PycharmProjects\LimeExamples\venv\Scripts\python.exe  
C:/Users/Orestis/PycharmProjects/LimeExamples/hate_tweets.py
Traceback (most recent call last):
  File "C:/Users/Orestis/PycharmProjects/LimeExamples/hate_tweets.py", line 1, in <module>
    import nltk
  File "C:\Users\Orestis\PycharmProjects\LimeExamples\venv\lib\site-packages\nltk\__init__.py", line 152, in <module>
    from nltk.stem import *
  File "C:\Users\Orestis\PycharmProjects\LimeExamples\venv\lib\site-packages\nltk\stem\__init__.py", line 29, in <module>
    from nltk.stem.snowball import SnowballStemmer
  File "C:\Users\Orestis\PycharmProjects\LimeExamples\venv\lib\site-packages\nltk\stem\snowball.py", line 32, in <module>
    from nltk.corpus import stopwords
  File "C:\Users\Orestis\PycharmProjects\LimeExamples\venv\lib\site-packages\nltk\corpus\__init__.py", line 66, in <module>
    from nltk.corpus.reader import *
  File "C:\Users\Orestis\PycharmProjects\LimeExamples\venv\lib\site-packages\nltk\corpus\reader\__init__.py", line 105, in <module>
    from nltk.corpus.reader.panlex_lite import *
  File "C:\Users\Orestis\PycharmProjects\LimeExamples\venv\lib\site-packages\nltk\corpus\reader\panlex_lite.py", line 15, in <module>
    import sqlite3
  File "C:\Users\Orestis\Anaconda3\lib\sqlite3\__init__.py", line 23, in <module>
    from sqlite3.dbapi2 import *
  File "C:\Users\Orestis\Anaconda3\lib\sqlite3\dbapi2.py", line 27, in <module>
    from _sqlite3 import *
ImportError: DLL load failed: The specified module could not be found.
thelaw

For anyone that has the same problem in the future by following Pavel Karateev's advice I was able to solve this. I created a normal conda environment and installed all the packages through anaconda prompt by using e.g. conda -install nltk in the conda virtual environment I had created.

From what I understand the problem was that I had created a venv with PyCharm UI using anaconda as a base which is a big mistake!

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

ImportError: DLL load failed: The specified module could not be found for numpy

From Dev

pyodbc ImportError: DLL load failed: The specified module could > not be found

From Dev

Python: ImportError: DLL load failed: The specified module could not be found

From Java

ImportError: DLL load failed: The specified module could not be found

From Java

ImportError: DLL load failed: The specified module could not be found

From Dev

Scipy ImportError: DLL load failed: The specified module could not be found

From Dev

Pyinstaller ImportError: DLL load failed: The specified module could not be found

From Dev

Tensorflow on windows - ImportError: DLL load failed: The specified module could not be found

From Dev

skimage - ImportError: DLL load failed: The specified module could not be found

From Dev

ImportError: DLL load failed: The specified module could not be found (sklearn)

From Dev

ktrain ImportError: DLL load failed: The specified module could not be found

From Dev

MeCab: “ImportError: DLL load failed: The specified module could not be found.”

From Dev

cx_Freeze ImportError: DLL load failed failed while importing _ctypes: The specified module could not be found

From Dev

Trying to install TensorFlow- GPU...failed with ImportError: DLL load failed: The specified module could not be found

From Dev

How can I bypass kivy module error: ImportError: DLL load failed: The specified module could not be found?

From Dev

OpenCV-Python ImportError: DLL load failed: The specified module could not be found

From Dev

Can run script from pycharm, but not from Terminal. ImportError: DLL load failed: The specified module could not be found

From Dev

ImportError: DLL load failed: The specified module could not be found. Tensorflow Chatbot

From Dev

from scipy.linalg import _fblas: ImportError: DLL load failed: The specified module could not be found

From Dev

Exception has occurred: ImportError DLL load failed while importing pdftotext: The specified module could not be found

From Dev

ImportError: DLL load failed while importing _psycopg: The specified module could not be found

From Dev

Unable to open ANACONDA or SPYDER: ImportError: DLL load failed: The specified module could not be found

From Dev

ver.2 PyGreSQL ERROR: from _pg import * ImportError: DLL load failed: The specified module could not be found

From Dev

ImportError: DLL load failed while importing pyexpat: The specified module could not be found

From Dev

Error when trying to import sklearn modules : ImportError: DLL load failed: The specified module could not be found

From Dev

Tensorflow-alpha-gpu issue ImportError: DLL load failed: The specified module could not be found

From Dev

ImportError: DLL load failed: The specified module could not be found. While attempting to import TensorFlow

From Dev

(ibm_db) ImportError: DLL load failed while importing ibm_db: The specified module could not be found

From Dev

ElastAlert ImportError: DLL load failed: The specified procedure could not be found

Related Related

  1. 1

    ImportError: DLL load failed: The specified module could not be found for numpy

  2. 2

    pyodbc ImportError: DLL load failed: The specified module could > not be found

  3. 3

    Python: ImportError: DLL load failed: The specified module could not be found

  4. 4

    ImportError: DLL load failed: The specified module could not be found

  5. 5

    ImportError: DLL load failed: The specified module could not be found

  6. 6

    Scipy ImportError: DLL load failed: The specified module could not be found

  7. 7

    Pyinstaller ImportError: DLL load failed: The specified module could not be found

  8. 8

    Tensorflow on windows - ImportError: DLL load failed: The specified module could not be found

  9. 9

    skimage - ImportError: DLL load failed: The specified module could not be found

  10. 10

    ImportError: DLL load failed: The specified module could not be found (sklearn)

  11. 11

    ktrain ImportError: DLL load failed: The specified module could not be found

  12. 12

    MeCab: “ImportError: DLL load failed: The specified module could not be found.”

  13. 13

    cx_Freeze ImportError: DLL load failed failed while importing _ctypes: The specified module could not be found

  14. 14

    Trying to install TensorFlow- GPU...failed with ImportError: DLL load failed: The specified module could not be found

  15. 15

    How can I bypass kivy module error: ImportError: DLL load failed: The specified module could not be found?

  16. 16

    OpenCV-Python ImportError: DLL load failed: The specified module could not be found

  17. 17

    Can run script from pycharm, but not from Terminal. ImportError: DLL load failed: The specified module could not be found

  18. 18

    ImportError: DLL load failed: The specified module could not be found. Tensorflow Chatbot

  19. 19

    from scipy.linalg import _fblas: ImportError: DLL load failed: The specified module could not be found

  20. 20

    Exception has occurred: ImportError DLL load failed while importing pdftotext: The specified module could not be found

  21. 21

    ImportError: DLL load failed while importing _psycopg: The specified module could not be found

  22. 22

    Unable to open ANACONDA or SPYDER: ImportError: DLL load failed: The specified module could not be found

  23. 23

    ver.2 PyGreSQL ERROR: from _pg import * ImportError: DLL load failed: The specified module could not be found

  24. 24

    ImportError: DLL load failed while importing pyexpat: The specified module could not be found

  25. 25

    Error when trying to import sklearn modules : ImportError: DLL load failed: The specified module could not be found

  26. 26

    Tensorflow-alpha-gpu issue ImportError: DLL load failed: The specified module could not be found

  27. 27

    ImportError: DLL load failed: The specified module could not be found. While attempting to import TensorFlow

  28. 28

    (ibm_db) ImportError: DLL load failed while importing ibm_db: The specified module could not be found

  29. 29

    ElastAlert ImportError: DLL load failed: The specified procedure could not be found

HotTag

Archive