Python Forum
Error in compiling cython extension on Python 3.6.4 on Windows 8
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error in compiling cython extension on Python 3.6.4 on Windows 8
#1
I am learning to use Cython from here

I have a setup.py file as below:

#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
print("Cython Hello World!")
I compile this cython extension on a Windows host 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

Quote: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

Quote: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": https://visualstudio.microsoft.com/downloads/

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 please give 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.
Reply


Messages In This Thread
Error in compiling cython extension on Python 3.6.4 on Windows 8 - by goldenmean - Jun-03-2019, 08:26 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  'Un-compiling' an .exe ? Stephen_8069 1 485 Apr-07-2025, 11:54 AM
Last Post: buran
  Create a new subclass in a Python extension based on an existing class voidtrance 6 1,400 Mar-25-2025, 06:37 PM
Last Post: voidtrance
  How to re-register .py file extension to new moved Python dir (on Windows)? pstein 5 1,349 Nov-06-2024, 03:06 PM
Last Post: DeaD_EyE
  Cython, Pandas, and Chained Assignment sawtooth500 4 3,113 Apr-13-2024, 04:18 AM
Last Post: sawtooth500
  Python C Extension Module loading issue on Cygwin mesibo 0 1,389 Sep-22-2023, 05:41 AM
Last Post: mesibo
  Python-for-Android:p4a: syntax error in main.py while compiling apk jttolleson 2 4,025 Sep-17-2022, 04:09 AM
Last Post: jttolleson
  I need to add data types to cython conversion python to c Good_AI_User 1 1,757 Aug-19-2022, 07:52 AM
Last Post: Gribouillis
  "SSL: CERTIFICATE_VERIFY_FAILED” error on Python 3.9.6 (Windows 10) rcmv 4 5,023 May-10-2022, 01:18 PM
Last Post: rcmv
  unable to load an image with C (Cython) HLD202 0 1,871 Jan-13-2022, 09:16 PM
Last Post: HLD202
  Cython np.where slows down the code Johanoosterwaal 1 2,509 Sep-01-2021, 07:33 AM
Last Post: Johanoosterwaal

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020