Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Python 

Error in compiling cython extension on Python 3.6.4 on Windows 8 using MS Visual Stud

I have a setup.py file as below:

Code
#from distutils.core import setup
from setuptools import setup, find_packages, Extension, Command
from Cython.Build import cythonize

setup(
   ext_modules = cythonize("cyt_hello_world.pyx")
)

And a simple print as below in file cyt_hello_world.pyx

Code
print("Cython Hello World!")

I compile this cython extension on Windows using below command

python setup.py build_ext --inplace

Whether I use distutils or setuptools in the setup.py file above, both give errors as below.

Error seen, If I use distutils

F:\PythonCode>python setup.py build_ext --inplace running build_ext building 'cyt_hello_world' extension

error: Unable to find vcvarsall.bat


If I use setuptools, below is the error

F:\PythonCode>python setup.py build_ext --inplace running build_ext building 'cyt_hello_world' extension

error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools":


I have Microsoft Visual Studio installed at path : C:\Program Files (x86)\Microsoft Visual Studio 12.0

I can see file vcvarsall.bat in MSVisual Studio 12.0 installation folder C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC

How can i point to this *.bat and resolve these errors if i use distutils OR
How can i fix the errors: "Microsoft Visual C++ 14.0 is required", if any different installation needed?

Can someone give any inputs?

NOTE: I have tried setting set VS90COMNTOOLS=%VS120COMNTOOLS% but no success, same error of vcvarsall.bat . I have also added C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC to my windows PATH variable, but no success.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by Bass_ReevesAug 20, 2023 01:44 AM 9 630 Aug 20, 2023 01:44 AM
Last Post: Lucky4L
[Shell] by Emre_Jan 12, 2021 11:16 PM 0 140 Jan 12, 2021 11:16 PM
Last Post: Emre_
[C#] by draxyeeJul 11, 2020 01:17 PM 7 192 Jul 11, 2020 01:17 PM
Last Post: HFDone