2015-08-21 57 views
0

我正在使用Python 3.4.3和PostgreSQL 9.4.4在Windows 7(64位)上安装psycopg,使用wheel文件(from http://www.lfd.uci.edu/~gohlke/pythonlibs/#psycopg)和命令:无法在Windows 7上使用Python 3.4.3和PostgreSQL 9.4.4安装psycopg

pip install psycopg2-2.6.1-cp34-none-win_amd64.whl 

我得到的错误:

psycopg2-2.6.1-cp34-none-win_amd64.whl is not a supported wheel on this platform. 

更新: 我尝试使用的easy_install命令:

easy_install psycopg2-2.6.1.win-amd64-py3.4-pg9.4.4-release.exe 

Searching for psycopg2-2.6.1.win-amd64-py3.4-pg9.4.4-release.exe 
Reading https://pypi.python.org/simple/psycopg2-2.6.1.win-amd64-py3.4-pg9.4.4-re 
lease.exe/ 
Couldn't find index page for 'psycopg2-2.6.1.win-amd64-py3.4-pg9.4.4-release.exe 
' (maybe misspelled?) 
Scanning index of all packages (this may take a while) 
Reading https://pypi.python.org/simple/ 
No local packages or download links found for psycopg2-2.6.1.win-amd64-py3.4-pg9 
.4.4-release.exe 
error: Could not find suitable distribution for Requirement.parse('psycopg2-2.6. 
1.win-amd64-py3.4-pg9.4.4-release.exe') 
+1

你的python安装是什么?运行python并在win32上粘贴第一行(例如'Python 2.7.10(默认,2015年5月23日,09:44:00)[MSC v.1500 64位(AMD64)]。 – kichik

回答

2

你需要安装psycopg2‑2.6.1‑cp34‑none‑win32.whl。你的Windows可能是64位的,但你的Python安装仍然是32位的。你安装的软件包应该与你的Python安装相匹配,而不是你的Windows安装。

这是一个常见问题,因为http://python.org默认情况下会将您重定向到Python 32位,即使在Windows 64位甚至是64位Chrome上浏览也是如此。

1

试试这个:

C:\>python -m easy_install --upgrade setuptools 
C:\>cd path\to\folder\psycopg 
D:\path\>python -m pip install psycopg2-2.6.1-cp34-none-win_amd64.whl 
+0

我收到消息“Usage: pip [options]没有这样的选项:-m“ – tyebillion

+0

你已经安装了一个pip吗?并且”pip -m“将不正确 –

+0

我正在使用pip 7.1.1并且没有”-m“选项。 – tyebillion