ImportError: DLL load failed : - when trying to import psycopg2 library

前端 未结 5 1954
萌比男神i
萌比男神i 2020-12-15 07:47
>>> import psycopg2
Traceback (most recent call last):
  File \"\", line 1, in 
  File \"C:\\Python26\\lib\\site-packages\\psycopg2\\__init__.py\", line 60, in 
    from          


        
相关标签:
5条回答
  • 2020-12-15 08:18

    On Windows, make sure your path includes the Postgres bin directory. In my machine it's c:\Programs\PostgreSQL\9.3\bin.

    0 讨论(0)
  • 2020-12-15 08:19

    You can also try installing win-psycopg from here

    0 讨论(0)
  • 2020-12-15 08:25

    Try to run the following command:

    pip install psycopg2-binary
    
    0 讨论(0)
  • 2020-12-15 08:31

    It is a problem with virtualenv and psycopg2. I have copied _psycopg.cp38-win_amd64.pyd from global python to \venv\Lib\site-packages\psycopg2 This worked for me.

    0 讨论(0)
  • 2020-12-15 08:44

    According to this thread you need to install an earlier version since there were problems with the latest build.

    Simply install an earlier version, (2.0.10 works great), even with PostgreSQL 8.4.x series.

    0 讨论(0)
提交回复
热议问题