繁体   English   中英

psycopg2安装错误:找不到vcvarsall.bat

[英]psycopg2 installation error: Unable to find vcvarsall.bat

我正在尝试将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

有人有主意吗? 谢谢..

psycopg2需要编译各种开发库。 在Windows上,这通常是通过使用某些版本的Visual Studio来自动进行的(这是vcvarsall.bat文件的全部内容),并且通常很麻烦。 幸运的是,Jason Erickson 在此处维护了psycopg2的Windows端口

我现在看到您正在使用Python 3.5,并且该页面上似乎没有该版本的发布。 幸运的是, Stack Overflow已经提供了答案 (其中一条评论说,链接页面上没有适用于Python 3.5的版本,但现在不再是真的)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM