Cython having issues with Python.h, and not generating .pyd file as needed.

324 views
Skip to first unread message

Sidd

unread,
Aug 22, 2021, 6:40:52 AM8/22/21
to cython-users
To make this brief, I am making a project, and I need Cython for it to work. I have read every single line of documentation when it comes to installing Cython on windows, and have followed exactly what has said. Despite this, I still can't get Cython to work properly. When I import the module, everything works fine. The issue arises when I try compiling from a .pyx file.

The C file gets generated just fine, but there are two issues. The first is that for whatever reason, I'm getting:

raise ValueError("Unknown MS Compiler Version 1929")

It doesn't end there. When I try looking for the pyd file, 0 files are generated. There just is no pyd file in the directory. In the C file, where it uses #include "Python.h", it shows an error, and gives the following message:

#include errors detected. Please update your includePath. IntelliSense features for this translation unit (C:\Users\...\Workspace\cython_test\example_py.c) will be provided by the Tag Parser.

I have tried searching all over for ways to solve this, but absolutely nothing has helped... I tried installing MSVC, and properly set up MinGW in my environment variables. I have tried restarting my computer, uninstalling and reinstalling Python, MinGW, VSCode, and even tried looking through the documentation for ways to solve this, all to no avail.

Blue

unread,
Aug 23, 2021, 4:43:14 PM8/23/21
to cython-users
How exactly do you compile the C file after it has been generated? You should follow Source Files and Compilation.

Sidd

unread,
Aug 25, 2021, 12:40:21 PM8/25/21
to cython-users
I eventually figured it out. I had to download C++ build tools, and manually put the path of Python.h in the cpp_config JSON for vscode.
Reply all
Reply to author
Forward
0 new messages