Python/PyQuery : Unable to find vcvarsall. bat ?

标签 python windows pyquery

我有 Python 2.7 并且我正在尝试使用 PyQuery,所以为了测试我只是输入了“import PyQuery”并且我得到了一个错误:

Traceback (most recent call last):
  File "C:\Users\Jacob\Documents\dupes.py", line 1, in <module>
    import pyquery
  File "C:\Python27\lib\site-packages\pyquery-1.2.1-py2.7.egg\pyquery\__init__.py", line 12, in <module>
    from .pyquery import PyQuery
  File "C:\Python27\lib\site-packages\pyquery-1.2.1-py2.7.egg\pyquery\pyquery.py", line 8, in <module>
    from lxml import etree
ImportError: No module named lxml

所以我转到命令提示符并尝试安装 lxml,但我得到了这个:

Building lxml version 2.3.5.
Building without Cython.
ERROR: 'xslt-config' is not recognized as an internal or external command,
operable program or batch file.

** make sure the development packages of libxml2 and libxslt are installed **

Using build configuration of libxslt
error: Setup script exited with error: Unable to find vcvarsall.bat

我真的不明白哪里出了问题或我应该做什么...有人可以帮忙吗?

谢谢。

编辑:

为了回应评论,我使用了easy install...

最佳答案

来自lxml的安装说明:

easy_install --allow-hosts=lxml.de,*.python.org lxml

在 MS Windows 上,以上将安装我们提供的二进制构建。如果还没有最新版本的二进制构建,请在 PyPI 中搜索包含它们的最后一个版本,并将该版本传递给 easy_install,如下所示:

easy_install --allow-hosts=lxml.de,*.python.org lxml==2.2.2

[编辑]

好的,2.2.2 就是一个例子。我去找你了,试试:

easy_install --allow-hosts=lxml.de,*.python.org lxml==2.3

关于Python/PyQuery : Unable to find vcvarsall. bat ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11890846/

相关文章:

Python 3D 阵列水平打印

windows - 为什么 git sparse checkout 会留下目录?

windows - 枚举同一进程中的开放端口

python - 使用 requests_html 时无法按预期提取结果

python - 将两个不同 dtype 的 numpy 数组组合成一个结构化数组

python - token 异常配置单元查询不匹配

python - ModuleNotFoundError : No module named aws_cdk

c++ - 全局范围 LPWSTR 在更改后恢复

python - Pyquery 抓取一个类名中有空格的类