简体   繁体   中英

#include <Python.h> no such file or directory for windows 10 fix

I am trying to build an extension in C for python 3 and I am using Windows. This might be a duplicate question but all the answers for the other question were for linux and I can run sudo on windows. How do I fix this problem?

If the problem is just the sudo -thing, you can have an admin-Terminal easily. Open your start menu, search for PowerShell, right click -> run as admin With Powershell you can use most important UNIX-commands.

If your IDE or Text Editor does not find a header file like the reason most likely is that this cpp-Header is either not installed or the Path to is not defined. Look for sth like "include-path" in your IDE´s Settings.

Nevermind, I found the answer. You must first search in your python directory for the 'include' folder, for example: "C:\Users\David\AppData\Local\Programs\Python\Python38-32\include", this is where mine is located and then search for Python.h and like that, you have the header.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM