簡體   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