繁体   English   中英

在Python中安装包时出现异常

[英]Exception while installing packages in 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

可能你错过了c ++编译器。

我从这里使用预打包版本安装它

我的问题在于virtualenv。 我无法安装一些软件包并得到同样的致命错误c1083。 我正在尝试Visual Studio和PTVS。 只是安装Microsoft Visual C ++编译器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”。

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

暂无
暂无

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

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