Не могу не как понять как установить библиотеку Python.h

Alex 0 Reputation points

Well, I need to install the Python.h library but I can't figure out how to install it in visual studio, some videos I couldn't find that would solve my problem.

The goal is to make a project that the main part of the code is written in C++, and a small code in Python, how to do it I do not know, could you tell me how to install the library Python.h or some other option that would help to realize my idea.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,402 questions
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,440 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Minxin Yu 9,361 Reputation points Microsoft Vendor


    It is recommended to install the latest python from the official website.

    User's image

    enter image description here

    enter image description here

    1. The installation location is default at

    Python.h is in folder:

    1. In addition, you need to add python311_d.lib as a dependency in your C++ project


    1. Add the folder C:\Users\Administrator\AppData\Local\Programs\Python\Python311 as the system environment path.

    Or put python311_d.dll in the same folder as your generated exe. python311_d.dll is in folder C:\Users\Administrator\AppData\Local\Programs\Python\Python311.

    Best regards,

    Minxin Yu

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.