Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.4k views
in Technique[技术] by (71.8m points)

python - Cannot open include file: 'io.h': No such file or directory

I was trying to compile a simple .pyx file using Cython.

print("hello")

Here's my setup.py:

from distutils.core import setup
from Cython.Build import cythonize

setup(
    ext_modules = cythonize("hello.pyx")
)

Then I run the command.

python setup.py build_ext --inplace

The error is shown below. I've struggled on googling it but found nothing helpful.

    running build_ext
    building 'hello' extension
    C:Program Files (x86)Microsoft Visual Studio 14.0VCBINcl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD
-IC:UsersJackieAppDataLocalContinuumAnaconda3include -IC:UsersJackieAppDataLocalContinuumAnaconda3include "-IC:Program Files (x86)Microsoft Visual Studio 14.0VCINCLUDE"
"-IC:Program Files (x86)Windows Kits10includewdfucrt"
"-IC:Program Files (x86)Windows KitsNETFXSDK4.6includeum"
"-IC:Program Files (x86)Windows Kits8.1includeshared"
"-IC:Program Files (x86)Windows Kits8.1includeum" "-IC:Program
Files (x86)Windows Kits8.1includewinrt" /Tchello.c
/Fobuildemp.win32-3.5Releasehello.obj  
    hello.c
    c:usersjackieappdatalocalcontinuumanaconda3includepyconfig.h(68):
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

Can someone help me to resolve the error, please?

I have Anaconda3 4.1.1, Python 3.5, and Visual Studio Express 2015 installed.

Question&Answers:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You need windows 10 SDK, Download visual studio build tools and install

  1. Visual C++ Build tools core features.
  2. MSVC toolset C++ 2019 v142 (x86,x64)
  3. Visual C++ 2019 Redistributable Update
  4. Windows 10 SDK (10.0.17763.0) for Desktop C++

the image from Rivalus


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...