Skip to content

Python.h: No such file or directory even after using "quick fix" #337

@michioD

Description

@michioD

Python version: 3.8.1
I added Python.h and Numpy on the path with a json file.

I tried compiling the animation example. And I got the following error:

PS C:\CPPScripts\cpp_tmp_scripts\matplotlib-cpp\examples> g++ .\animation.cpp -o animation
In file included from .\animation.cpp:3:
.\../matplotlibcpp.h:5:10: fatal error: Python.h: No such file or directory
 #include <Python.h>
          ^~~~~~~~~~
compilation terminated.

Apparently matlabplotcpp.h still doesn't see the Python.h file despite I put in the required paths.

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**",
                "C:\\Users\\foo\\AppData\\Local\\Programs\\Python\\Python38-32\\include",
                "C:\\Users\\foo\\AppData\\Local\\Programs\\Python\\Python38-32\\lib\\site-packages\\numpy\\core\\include"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "compilerPath": "C:\\Strawberry\\c\\bin\\gcc.exe",
            "cStandard": "gnu17",
            "cppStandard": "gnu++14",
            "intelliSenseMode": "windows-gcc-x64"
        }
    ],
    "version": 4
}

How do I fix this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions