Info:
Python Version : 3.7.4
Platform : win 10 64 bit
I am trying to compile the file compileModule.py
using command :
python compileModule.py build_ext --inplace
compileModule.py:
from distutils.core import setup, Extension
from distutils.sysconfig import *
from distutils.util import *
from Cython.Distutils import build_ext
import numpy
import os
import os.path
try:
from distutils.command.build_py import build_py_2to3 \
as build_py
except ImportError:
from distutils.command.build_py import build_py
try:
from Cython.Distutils import build_ext
except ImportError:
use_cython = False
else:
use_cython = True
py_inc = [get_python_inc()]
np_lib = os.path.dirname(numpy.__file__)
np_inc = [os.path.join(np_lib, 'core/include')]
ext_inc = os
sourcefiles = ["utilFunctions.c", "cutilFunctions.pyx"]
setup(
cmdclass = {'build_ext': build_ext},
ext_modules = [Extension("utilFunctions_C",sourcefiles, libraries=['m'], include_dirs=py_inc + np_inc)]
)
After executing the above command I got an error :
Unable to find vcvarsall.bat
I downloaded and installed the Build Tools for Visual Studio 2017 by following the solution on this post.
Then i execute the below command again :
python compileModule.py build_ext --inplace
which gives a new error:
LINK : fatal error LNK1181: cannot open input file 'm.lib'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.22.27905\\bin\\HostX86\\x64\\link.exe' failed with exit status 1181
Now I am stuck with this error. Does anyone have any idea how to solve this error?
P.S. I opened all cmd inside Vs code but still same error :