安装Python包时出现异常
我在安装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
3 个回答
0
我也遇到了同样的错误信息,后来发现问题出在我虽然把Visual Studio和Python的路径正确地设置到了PATH变量里,但我忘了加上C:\Windows\System32这个路径。
0
我的问题出现在一个虚拟环境里。我无法安装一些软件包,并且总是遇到同样的致命错误c1083。我尝试了Visual Studio和PTVS。仅仅安装了适用于Python 2.7的Microsoft Visual C++编译器 https://www.microsoft.com/en-us/download/details.aspx?id=44266 并不能解决这个错误,虽然这个编译器是必须的。
我在这里找到了解决方案 http://blog.ionelmc.ro/2014/12/21/compiling-python-extensions-on-windows/
虚拟环境中安装的setuptools版本太旧(3.6)。你需要把它删除,然后重新安装。不过,在Visual Studio解决方案资源管理器的“安装Python包”窗口中,不要用“setuptools”作为模块名来安装,而是用“setuptools>=6.0”。
1
可能你缺少了C++编译器。
我是在 这里 下载的一个预打包的版本来安装它。