[英]How do I install python_ldap on 64 bit windows 7?
I'm using python 2.7.6 and in my code I have a line:我正在使用 python 2.7.6,在我的代码中有一行:
import psycopg2.extensions
which I've installed using pip.我已经使用 pip 安装了它。 Next, my editor tells me, that psycopg2 requires python_ldap=2.4.19.
接下来,我的编辑告诉我,psycopg2 需要 python_ldap=2.4.19。 However, in the PyPI repository, there's only a 32 bit version, which doesn't work, since my Windows is 64 bit.
但是,在 PyPI 存储库中,只有 32 位版本,这不起作用,因为我的 Windows 是 64 位。 There's a 64 bit version of python_ldap=2.4.28, avaliable here , however running
有一个 64 位版本的 python_ldap=2.4.28,可用在这里,但是正在运行
pip install python_ldap-2.4.28-cp27-cp27m-win_amd64.whl
in the windows command line returns在 windows 命令行中返回
python_ldap-2.4.28-cp27-cp27m-win_amd64.whl is not a supported wheel on this platform.
in red, which I guess is an error meassage.红色,我猜这是一个错误消息。 So, in the end, what should I do to have the package installed on my laptop?
那么,最后,我应该怎么做才能在我的笔记本电脑上安装这个软件包?
For anyone who's facing this, I solved this problem by installing the wheel from http://www.lfd.uci.edu/~gohlke/pythonlibs/#python-ldap .对于任何面临这个问题的人,我通过从http://www.lfd.uci.edu/~gohlke/pythonlibs/#python-ldap安装轮子解决了这个问题。
Cheers.干杯。
EDIT: I did this on a 64 bit Windows 10 machine, but I presume the same solution applies to Windows 7.编辑:我在 64 位 Windows 10 机器上执行此操作,但我认为相同的解决方案适用于 Windows 7。
$ python --version Python 3.6.0 $ python --version Python 3.6.0
pip install --only-binary :all: python_ldap-3.1.0- cp36-cp36m -win_amd64.whl pip install --only-binary :all: python_ldap- 3.1.0-cp36 - cp36m- win_amd64.whl
Make sure you choose the .whl file version matching the python install version确保选择与 python 安装版本匹配的 .whl 文件版本
pip install --only-binary :all: python_ldap-3.1.0-cp36-cp36m-win_amd64.whl
Processing c:\users\sthomas05\downloads\python_ldap-3.1.0-cp36-cp36m-win_amd64.whl
Requirement already satisfied: pyasn1>=0.3.7 in c:\users\sthomas05\appdata\roaming\python\python36\site-packages (from python-ldap==3.1.0) (0.4.5)
Requirement already satisfied: pyasn1-modules>=0.1.5 in c:\users\sthomas05\appdata\roaming\python\python36\site-packages (from python-ldap==3.1.0) (0.2.4)
Installing collected packages: python-ldap
Successfully installed python-ldap-3.1.0
As mentioned on the official website the unofficial package from on Christoph Gohlke's page should work.正如官方网站上提到的,来自 Christoph Gohlke 页面的非官方软件包应该可以工作。 Latest update is from 3rd of July, so it seems to be pretty up to date.
最新更新是从 7 月 3 日开始的,所以它似乎是最新的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.