我正在按照heroku关于如何在Windows上使用python和django构建Web项目的说明进行操作,但无法找出我的LNK2001 psycopg2错误。
教程链接:
我正在运行以下命令:
$ pip install -r requirements.txt --allow-all-external
错误输出如下:
Creating library build\temp.win32-2.7\Release\psycopg\_psycopg.lib and object build\temp.win32-2.7\Release\psycopg\_psycopg.exp
pqpath.obj : error LNK2019: unresolved external symbol _PQclear referenced in function _pq_raise
connection_int.obj : error LNK2001: unresolved external symbol _PQclear
cursor_type.obj : error LNK2001: unresolved external symbol _PQclear
...
build\lib.win32-2.7\psycopg2\_psycopg.pyd : fatal error LNK1120: 62 unresolved externals
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\BIN\\link.exe' failed with exit status 1120
----------------------------------------
←[31m Command "C:\Python27\python.exe -c "import setuptools, tokenize;__file__='c:\\users\\mariss~1.nie\\appdata\\local\\temp\\pip-build-vojshb\\p
ycopg2\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\
ariss~1.nie\appdata\local\temp\pip-nuj6xa-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\use
s\mariss~1.nie\appdata\local\temp\pip-build-vojshb\psycopg2←[0m
我正在使用以下内容:
我已经放入C:\Program Files\PostgreSQL\9.4\bin;C:\Python27\;C:\Python27\Scripts\
了PATH变量。
有什么想法吗?
就我而言,我更改了32位上的安装postgres,并且我已经通过了此错误。
我不小心安装了64位安装postgres 9.4.1。之后,将发出任何试图编译和链接此错误的尝试。尝试将编译器更改为mingv32时,我注意到他在库libpg.dll(未知格式)中出错。然后,我在根目录(c:/ postgreSQL)中卸载并安装了Postgres 32位版本9.4的系统。问题已解决。
就我而言,配置是相同的,但是我安装了附加的MS Visual C ++ Express 10版本。
配置:
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句