【问题标题】:Installing lxml for Python 3.3 on windows 7在 Windows 7 上为 Python 3.3 安装 lxml
【发布时间】:2014-07-17 08:54:00
【问题描述】:

我正在尝试在 Windows 7 上为 Python 3.3 安装 lxml,但是当我这样做时:

pip install lxml

我有这个错误:

error: command 'gcc' failed with exit status 1

我检查了 gcc.exe 是否在 MinGW 文件夹中,并且它似乎已正确安装。 我试过了:

gcc -v

我在其中一条回复中获得:gcc version 4.6.2

这是路径的一部分:

C:\Python33;C:\MinGW\bin;C:\Python33\Scripts;C:\Python33\Lib\site-packages

我真的不明白为什么安装不工作

【问题讨论】:

    标签: python-3.x windows-7 pip lxml


    【解决方案1】:

    好的,我找到了解决方案,这有点疯狂,我不知道它为什么会起作用。我使用的是 32 位和 64 位,但似乎程序只在 32 位 Python 文件夹中搜索 lxml,所以如果有人在我的情况下:

    1. 使用this site提供的安装程序安装lxml,但完成后,将lxml文件夹移动到32位 Python文件夹

    2. 使用pip install pykml64位 Python文件夹中安装pyKml

    3. 通过添加:C:\Python33_32bits;C:\Python33_32bits\Scripts;C:\Python33_32bits\Lib 更改 Windows 路径,只需将 Python33_32bits 更改为 32 位 Python 文件夹

    4. 通过这些步骤,我可以导入 lxml 并且不再遇到问题:from lxml import etree

    可能其中一个步骤是不必要的,但它对我有用,所以我更愿意分享我完成的所有步骤。 (对不起我的英语语法......)

    【讨论】:

      猜你喜欢
      • 2014-05-23
      • 1970-01-01
      • 1970-01-01
      • 2013-12-13
      • 2020-03-17
      • 2013-11-23
      • 2013-12-25
      • 1970-01-01
      • 2020-05-22
      相关资源
      最近更新 更多