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

2024-04-20 02:33:31 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试将我的django1.9项目连接到postgresql数据库。首先我需要安装psycopg2。{opg从我的心理文件中得到。但是我无法安装,我有一个“找不到”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

有人有主意吗?谢谢您。。在


Tags: pytestbuildlibtestswinusersoptional
1条回答
网友
1楼 · 发布于 2024-04-20 02:33:31

psycopg2需要编译各种开发库。在Windows上,这通常是通过使用visualstudio的某个版本来实现的vcvarsall.bat公司文件是所有的,通常是一个巨大的痛苦。幸运的是,jasonerickson维护了一个Windows端口psycopg2here.

我现在看到您使用的是Python3.5,而该页面上似乎没有该版本的版本。幸运的是,already on Stack Overflow.有一个答案(其中一条评论说链接页面上没有Python3.5的版本,但这不再是真的了)

相关问题 更多 >