Skip to content Skip to sidebar Skip to footer

I Have Psycopg2 Installed In Virtual Env, But Still Getting Importerror Psycopg2

I followed the following steps: [I am using Windows 8, Python 2.7.6] I created a virtual environment venv and then did pip install on requirements.txt to install all the libraries

Solution 1:

Unfortunately, psycopg2 needs to compile on each architecture; and I am sure if you checked the output of pip install psycopg2 you would have noticed some errors (even though, in the end, it will end up installing it).

It is best to install the pre-compiled windows binary, which you can find at this website.


Solution 2:

I had the same problem in windows and since i had installed psycopg2 both on the system python and in virtual environment, I found that with LIB/site-packages both had a folder named psycopg2 though within the virtual environment the contents were fewer.

It worked well when I copied the contents of the system Lib\site-packages\psycopg2 to those of the corresponding file in virtual environment.


Post a Comment for "I Have Psycopg2 Installed In Virtual Env, But Still Getting Importerror Psycopg2"