【发布时间】:2015-12-09 23:08:11
【问题描述】:
我正在尝试将我的 django 1.9 项目连接到 postgresql 数据库。首先我需要安装 psycopg2。我从 http://www.lfd.uci.edu/~gohlke/pythonlibs/#psycopg 获得了我的 psycopg 文件。但是我无法安装,出现“无法找到 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 -
这就是答案。非常感谢..
标签: python django postgresql