我想連接我的django 1.9項目到postgresql數據庫。首先我需要安裝psycopg2。我從http://www.lfd.uci.edu/~gohlke/pythonlibs/#psycopg得到我的psycopg文件。不過,我無法安裝,我有一個「無法找到vcvarsall.bat」錯誤。psycopg2安裝錯誤:無法找到vcvarsall.bat
我的python版本是3.5.1。
這是我的錯誤;
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
有沒有人有想法?謝謝..
使用下載的wheel文件安裝psycopg2的命令是'c:\ python \ python35 \ python.exe -m pip install psycopg2-2.6.1-cp35-none-win_amd64.whl' – cgohlke
這就是答案。非常感謝你.. – kbrk