4

I am Getting this Exception while installing packages in Python. uninstalled python and installed it again but there is no

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
Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343

3 Answers3

1

Probably you are missing the c++ compiler.

I installed it using a pre-packaged version from here

Mikael
  • 3,148
  • 22
  • 20
0

My problem was inside a virtualenv. I could not install some packages and got the same fatal error c1083. I was trying Visual Studio and PTVS. Just installing Microsoft Visual C++ Compiler for Python 2.7 https://www.microsoft.com/en-us/download/details.aspx?id=44266 was not enough to fix the error, despite it is needed.

I have found the solution here http://blog.ionelmc.ro/2014/12/21/compiling-python-extensions-on-windows/

The setuptools installed by virtualenv is too old (3.6). You need to remove it and reinstalling but, in the "Install python package" window in Visual Studio solution explorer, instead of using "setuptools" as the module name to install use "setuptools>=6.0".

Márcio Moreira
  • 477
  • 4
  • 16
0

Got the same error message and found the cause was that while I had set up the PATH variable correctly with the paths to Visual Studio and Python, I forgot to add the C:\Windows\System32 path.

Cito
  • 5,365
  • 28
  • 30