title: #include <Python.h> CMake project Visual Studio 2019 windows 10
body: <p>I am having some trouble building a simple C++ project in Windows.</p>
  <p>What I want to do:</p>
  <ol>
  <li>Run some simple code in C++</li>
  <li>Print a graph using the matplotlibcpp library.</li>
  </ol>
  <p>I installed the matplotlibcpp library by using vcpkg.
  I have a problem with the matplotlibcpp.h header including Python.h.</p>
  <p>I obtain this error:
  Error code 1083 - Cannot open include file: 'Python.h': No such file or directory.</p>
  <p>I have anaconda installed on my PC and the path to Python is added to the environment PATH in Windows.</p>
  <p>My code:</p>
  <pre><code>#include &quot;matplotlibcpp.h&quot;
  
  using namespace std;
  namespace plt = matplotlibcpp;
  
  int main()
  {
      cout &lt;&lt; &quot;Hello!&quot; &lt;&lt; endl;
  
      plt::plot({ 1,3,2,4 });
      plt::show();
  
      return 0;
  }
  </code></pre>
  <p>My CMakeList.txt:</p>
  <pre><code>cmake_minimum_required (VERSION 3.8)
  
  project (&quot;MyProj&quot; VERSION 1.0)
  
  include_directories(include)
  
  
  # Add source to this project's executable.
  file(GLOB_RECURSE SOURCES &quot;src/*.cpp&quot;)
  add_executable (MyEx ${SOURCES} &quot;main.cpp&quot; &quot;main.h&quot;)
  
  find_path(MATPLOTLIB_CPP_INCLUDE_DIRS &quot;matplotlibcpp.h&quot;
              HINTS
              C:/Users/claudiop/dev/vcpkg/vcpkg/installed/x86-windows/include/matplotlibcpp.h)
     target_include_directories(MyEx PRIVATE ${MATPLOTLIB_CPP_INCLUDE_DIRS})
  
  </code></pre>
  <p>I tried to follow indications in this post
  <a href="https://stackoverflow.com/questions/44533679/cant-include-python-h-in-visual-studio">can&#39;t include Python.h in visual studio</a>
  but I did not manage to solve the problem.</p>
  <p>Any suggestion/help/hint?</p>