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

Ross

I have a django project that I am trying to connect with a postgres database. However when I try to run the command python manage.py makemigrations I get the following error:

(card_crate_venv) G:\Shared drives\Card Crate\Software Development\card_crate_admin\website>python manage.py makemigrations
Traceback (most recent call last):
  File "G:\Shared drives\Card Crate\Software Development\card_crate_admin\website\manage.py", line 22, in <module>
    main()
  File "G:\Shared drives\Card Crate\Software Development\card_crate_admin\website\manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "G:\Shared drives\Card Crate\Software Development\card_crate_admin\card_crate_venv\lib\site-packages\django\core\management\__init__.py", line 401, in execute_from_command_line
    utility.execute()
  File "G:\Shared drives\Card Crate\Software Development\card_crate_admin\card_crate_venv\lib\site-packages\django\core\management\__init__.py", line 377, in execute
    django.setup()
  File "G:\Shared drives\Card Crate\Software Development\card_crate_admin\card_crate_venv\lib\site-packages\django\__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "G:\Shared drives\Card Crate\Software Development\card_crate_admin\card_crate_venv\lib\site-packages\django\apps\registry.py", line 91, in populate
    app_config = AppConfig.create(entry)
  File "G:\Shared drives\Card Crate\Software Development\card_crate_admin\card_crate_venv\lib\site-packages\django\apps\config.py", line 90, in create
    module = import_module(entry)
  File "C:\Users\Ross Waston\AppData\Local\Programs\Python\Python39\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "G:\Shared drives\Card Crate\Software Development\card_crate_admin\card_crate_venv\lib\site-packages\psycopg2\__init__.py", line 51, in <module>
    from psycopg2._psycopg import (                     # noqa
ImportError: DLL load failed while importing _psycopg: The specified module could not be found.

settings.py:

INSTALLED_APPS = [
    'psycopg2',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'dashboard.apps.DashboardConfig',
]

...

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'development',
        'USER': 'superuser',
        'PASSWORD': 'admin',
        'HOST': '192.168.1.100',
        'PORT': '5432',
    }
}

packages:

enter image description here

Ross

I found that this does not work because I was using python 3.9 as a interpreter. In PyCharm, I created a new interpreter, setting the base interpreter as python 3.7 and reinstalled all my needed packages it worked as expected

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

cx_Freeze ImportError: DLL load failed failed while importing _ctypes: 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 pyexpat: The specified module could not be found

From Dev

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

From Dev

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

From Dev

ImportError: DLL load failed while importing numpy_ops: The specified module could not be found. when importing spacy in Python

From Dev

How to fix 'ImportError: DLL load failed: The specified procedure could not be found.' while importing tensorflow-gpu?

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

NLTK 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

DLL load failed while importing aggregations: The specified module could not be found pyhton pandas excel files merging

From Dev

DLL load failed while importing ft2font: 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

Python: "ImportError: DLL load failed: The specified module could not be found." Problems when importing ffn (finance library for python)

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

Error importing numpy from Anaconda, using conda (DLL load failed: The specified module could not be found)

From Dev

"DLL load failed: The specified module could not be found" error in importing "kfold" from sklearn

From Dev

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

Related Related

  1. 1

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

  2. 2

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

  3. 3

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

  4. 4

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

  5. 5

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

  6. 6

    ImportError: DLL load failed while importing numpy_ops: The specified module could not be found. when importing spacy in Python

  7. 7

    How to fix 'ImportError: DLL load failed: The specified procedure could not be found.' while importing tensorflow-gpu?

  8. 8

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

  9. 9

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

  10. 10

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

  11. 11

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

  12. 12

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

  13. 13

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

  14. 14

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

  15. 15

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

  16. 16

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

  17. 17

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

  18. 18

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

  19. 19

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

  20. 20

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

  21. 21

    DLL load failed while importing aggregations: The specified module could not be found pyhton pandas excel files merging

  22. 22

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

  23. 23

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

  24. 24

    Python: "ImportError: DLL load failed: The specified module could not be found." Problems when importing ffn (finance library for python)

  25. 25

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

  26. 26

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

  27. 27

    Error importing numpy from Anaconda, using conda (DLL load failed: The specified module could not be found)

  28. 28

    "DLL load failed: The specified module could not be found" error in importing "kfold" from sklearn

  29. 29

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

HotTag

Archive