2

I am following this post: Creating a C++ extension for Python

I have installed VS2017 on my fresh new Windows10LTSB system, with Desktop development with C++ and Python Development (including Python native development tools) workloads, following Installing Python support in Visual Studio on Windows

My Python application worked fine.

I stuck at the Create the core C++ project section for almost a day, I created Empty Project following the post and also tried creating a Python Extension Module template.

The error is E1696 cannot open source file "Python.h".

I strictly followed the post to set up the project property and tied several times, but it did not work at all.

My Python directory is C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64, which was also my Python application's default environment.

I have not installed the official Python distribution, because Python environments mentions that VS ignore PYTHONPATH environment variable.

1

1 Answer 1

2

I have included my Python directory, which is

C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64 

I had done this before, but another problem occured. I found this post Creating a C++ extension for Python and retarget the C++ project target platform to x64 in the Solution Property and solved the problem.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.