Cannot import Python.h

  c++

I’ve been recently programming in C++, and I’m making a program that calls a python program
(I’m testing calling python scripts and getting their output in C++, so my script is a simple piece of code)

I’m using this tutorial

The issue I’m getting is that my editor can’t find the file <Python.h> and <stdafx.h> (I use VS Code and it says "Cannot open source file").
I don’t know how to fix this.

I looked this issue up a bit, and I didn’t understand any of the results I was getting.

I also want to mention that I can import other files such as and , so I think this problem only occurs for libraries that don’t come with the C++ compiler.

I want to know how to fix this issue, as I plan on writing some programs with C++ and python working together (I’m thinking of ideas for this at the moment).

Source: Windows Questions C++

LEAVE A COMMENT