简体   繁体   English

Python 3.5 - 如何在 Windows 7 64 位中安装 lxml

[英]Python 3.5 - how to install lxml in Windows 7 64 bits

I am trying to install lxml with Python (32 bits) 3.5.1, on Windows 7 64 bits.我正在尝试在 Windows 7 64 位上使用 Python(32 位)3.5.1 安装 lxml。 I tried pip install lxml , but I got the famous error for missing "vcvarsall.bat".我试过pip install lxml ,但我因为缺少“vcvarsall.bat”而得到了著名的错误。 If I try to Install visual studio 2015, it requires 6 GB of free space, which I do not have available at the moment, and I'd rather not install a package which I do not plan to use.如果我尝试安装 Visual Studio 2015,它需要 6 GB 的可用空间,我目前没有可用空间,我宁愿不安装我不打算使用的包。

I tried downloaded the wheel as suggested here and here , but I still get the whl file "is not a supported wheel on this platform".我尝试按照此处此处的建议下载轮子,但我仍然收到 whl 文件“在此平台上不受支持的轮子”。 Wheel and pip are upgraded to the latest versions. Wheel 和 pip 升级到最新版本。 What am I missing...?我错过了什么......?

I have been struggling with this today.我今天一直在为此而苦苦挣扎。 I found, elsewhere on stackoverflow.com, this two-part and quick solution, which resulted in python no longer complaining when I tried to use lxml:我在 stackoverflow.com 的其他地方发现了这个由两部分组成的快速解决方案,这导致当我尝试使用 lxml 时 python 不再抱怨:

  1. go to this repository and download a version which matches your Python installation (the version number, and 32- vs 64-bit. I use Python 3.5.1 64-bit, installed on Windows 10, so on that page, I chose lxml-3.6.0-cp35-cp35m-win_amd64.whl . You say you use the 32-bit version, so use a version that matches that.转到此存储库并下载与您的 Python 安装匹配的版本(版本号和 32 位与 64 位。我使用 Python 3.5.1 64 位,安装在 Windows 10 上,因此在该页面上,我选择了lxml- 3.6.0-cp35-cp35m-win_amd64.whl . 你说你使用 32 位版本,所以使用匹配的版本。

My download directory is d:\\Downloads.我的下载目录是 d:\\Downloads。 Python must be in your PATH environment variable for the next step to work. Python 必须在您的 PATH 环境变量中,以便下一步工作。 Use a command like the following, changing "D:\\Downloads" to the pathname to your download directory.使用如下命令,将“D:\\Downloads”更改为下载目录的路径名。 Then, at a DOS prompt, type:然后,在 DOS 提示符下,键入:

  1. python -m pip install "D:\\Downloads\\lxml-3.6.0-cp35-cp35m-win_amd64.whl" lxml-3.6.0-cp35-cp35m-win_amd64.whl python -m pip install "D:\\Downloads\\lxml-3.6.0-cp35-cp35m-win_amd64.whl" lxml-3.6.0-cp35-cp35m-win_amd64.whl

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

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