【问题标题】:Exception while installing packages in Python在 Python 中安装包时出现异常
【发布时间】:2013-03-15 12:05:13
【问题描述】:

我在 Python 中安装软件包时遇到此异常。 卸载python并重新安装,但没有

C:\Users\ramasastri.g\Desktop\pycrypto-2.6>python setup.py install
running install
running build
running build_py
running build_ext
warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.

building 'Crypto.Random.OSRNG.winrandom' extension
C:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Isrc/ -Isrc/inc-msvc/ -IC:\Python27\include -IC:\Python27\PC /Tcsrc/winrand.c /Fobuild\temp.win32-2.7\Release\src/winrand.obj
winrand.c
c:\python27\include\pyconfig.h(68) : fatal error C1083: Cannot open include file: 'io.h': No such file or directory
error: command '"C:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\cl.exe"' failed with exit status 2

【问题讨论】:

    标签: python django python-2.7


    【解决方案1】:

    您可能缺少 c++ 编译器。

    我使用来自here 的预打包版本安装它

    【讨论】:

    • 我从这里下载了它自己。但是没有用
    • 不仅对于 PyCrypto 同样的例外是安装 lxml-3.1.0
    • “fabric-master”包的相同例外。
    【解决方案2】:

    我的问题是在 virtualenv 中。我无法安装某些软件包并得到相同的致命错误 c1083。我正在尝试 Visual Studio 和 PTVS。仅安装 Microsoft Visual C++ Compiler for Python 2.7 https://www.microsoft.com/en-us/download/details.aspx?id=44266 并不足以修复错误,尽管需要它。

    我在这里找到了解决方案http://blog.ionelmc.ro/2014/12/21/compiling-python-extensions-on-windows/

    virtualenv 安装的 setuptools 太旧(3.6)。您需要删除它并重新安装,但在 Visual Studio 解决方案资源管理器的“安装 python 包”窗口中,不要使用“setuptools”作为模块名称来安装,而是使用“setuptools>=6.0”。

    【讨论】:

      【解决方案3】:

      收到相同的错误消息,发现原因是,虽然我已使用 Visual Studio 和 Python 的路径正确设置了 PATH 变量,但我忘记添加 C:\Windows\System32 路径。

      【讨论】:

        猜你喜欢
        • 2012-10-17
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-07-08
        • 1970-01-01
        • 2017-05-09
        • 2020-10-27
        • 2023-04-10
        相关资源
        最近更新 更多