Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'io.h': No such file or directory during "pip install netifaces"

Tags:

python

c

I tried to install netifaces in Python 3.6.2 by:

pip install netifaces

but when I run it in cmd, I get this error:

c:\users\seyed_vahid\appdata\local\programs\python\python36\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe' failed with exit status 2

How can I fix it?

like image 623
naghi Avatar asked Aug 27 '17 12:08

naghi


2 Answers

Try open VS Installer and install something like

VC++ 2015 v140 toolset

like image 168
jerryc05 Avatar answered Sep 18 '22 11:09

jerryc05


I just had a frustrating day trying to find a way to make this work as well. (I use the Visual Studio, Python, Windows combination).

When getting build errors during pip installs (io.h, rc.exe not found etc), in my case with netifaces / pychromecast (but the issue is the same for all), make the following changes / additions to your environment variables:

INCLUDE (create if needed)

C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\SDK\ScopeCppSDK\SDK\include\ucrt;C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\SDK\ScopeCppSDK\SDK\include\shared;C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\SDK\ScopeCppSDK\SDK\include\um

LIB (create if needed)

C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\SDK\ScopeCppSDK\SDK\lib

Add to PATH

C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\SDK\ScopeCppSDK\SDK\bin

After making these changes I was able to install / compile things properly

like image 29
Jeroen Ritmeijer Avatar answered Sep 21 '22 11:09

Jeroen Ritmeijer