I am attempting to build my cython code using this setup.py file:
from distutils.core import setup
from Cython.Build import cythonize
import numpy as np
setup(
name="My Cython Project",
ext_modules=cythonize("*.pyx", include_path=[np.get_include()], language="c++")
)
and
python setup.py build_ext --inplace
But am getting the error:
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
But I installed the build tools and I know they work because I can manually build my project using these commands in the Developer Command Prompt for VS 2019:
cython -a -3 --cplus Myfile.pyx
cl /LD /O2 /EHsc [ include files ] Myfile.cpp [ python 3.8 lib ]
Why does cython think the build tools are not installed? Do I need to add something to PATH?
(I run the same project on my macOS machine with gcc installed and it works perfectly.)