Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows missing Python.h

I'm trying to run a sample Theano code that uses GPU on windows. My python (with python-dev and Theano and all required libraries) was installed from Anaconda. This is the error I run into:

Cannot open include file: 'Python.h': No such file or directory

My Python.h is actually in c://Anaconda/include/

I'm guessing that I should add that directory to some environmental variable, but I don't know which.

like image 368
user1934733 Avatar asked Nov 02 '15 08:11

user1934733


People also ask

How do I fix python H No such file or directory?

You encounter "Python. h: No such file or directory" error while trying to build a shared library using the file extension of another language ( e.g. 'C' ). If you are trying to build a shared library using the file extension of another language, you need to install the correct development version of Python.

What is python H?

Python.h is nothing but a header file. It is used by gcc to build applications. You need to install a package called python-dev. This package includes header files, a static library and development tools for building Python modules, extending the Python interpreter or embedding Python in applications.


1 Answers

If you are using Visual Studio in Windows, right-click on your project in the Solution Explorer and navigate as follows: Properties -> C/C++ -> General -> Additional Include Directories -> Add C:/Anaconda/include/ (or wherever your Anaconda install is located)

like image 197
acai Avatar answered Oct 23 '22 11:10

acai