kbrk
kbrk

Reputation: 660

psycopg2 installation error: Unable to find vcvarsall.bat

I'm trying connect my django 1.9 project to postgresql database. First of all i need to install psycopg2. I got my psycopg file from http://www.lfd.uci.edu/~gohlke/pythonlibs/#psycopg . However I could not install, I have an "Unable to find vcvarsall.bat" error.

My python version is 3.5.1.

Here is my error;

copying tests\test_quote.py -> build\lib.win-amd64-3.5\psycopg2\tests
copying tests\test_transaction.py -> build\lib.win-amd64-3.5\psycopg2\tests
copying tests\test_types_basic.py -> build\lib.win-amd64-3.5\psycopg2\tests
copying tests\test_types_extras.py -> build\lib.win-amd64-3.5\psycopg2\tests

copying tests\test_with.py -> build\lib.win-amd64-3.5\psycopg2\tests
copying tests\__init__.py -> build\lib.win-amd64-3.5\psycopg2\tests
Skipping optional fixer: buffer
Skipping optional fixer: idioms
Skipping optional fixer: set_literal
Skipping optional fixer: ws_comma
running build_ext
building 'psycopg2._psycopg' extension
error: Unable to find vcvarsall.bat

----------------------------------------
Command "c:\python\python35\python.exe -c "import setuptools, tokenize;__file__=
'C:\\Users\\User\\AppData\\Local\\Temp\\pip-build-4q_3mvan\\psycopg2\\setup.py';
exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\
n'), __file__, 'exec'))" install --record C:\Users\User\AppData\Local\Temp\pip-e
kz8kaam-record\install-record.txt --single-version-externally-managed --compile"
 failed with error code 1 in C:\Users\User\AppData\Local\Temp\pip-build-4q_3mvan
\psycopg2

Does anyone have an idea ? Thank you..

Upvotes: 0

Views: 1226

Answers (1)

James J.
James J.

Reputation: 236

psycopg2 needs to be compiled various development libraries. On Windows this is usually automated by using some version of Visual Studio -- which is what the vcvarsall.bat file is all about -- and is usually a huge pain. Fortunately, Jason Erickson maintains a Windows port of psycopg2 here.

I see now that you're using Python 3.5, and there doesn't seem to be a release for that version available on that page. Fortunately, there's an answer for that already on Stack Overflow. (One of the comments says there's not a version for Python 3.5 on the linked page, but that's not true anymore)

Upvotes: 1

Related Questions