DevOps | Cloud | Analytics | Open Source | Programming





How To Fix - "error: Unable to find vcvarsall.bat"



In this post, we will see How To Fix - "error: Unable to find vcvarsall.bat". This is one of the errors commonly found while installing some packages in Python.


error: Unable to find vcvarsall.bat

  • When you try to install a package using say "pip install", if a wheel is available for your running version of Python, it gets downloaded and extracted. You do not need compilers as the extension modules included in wheels are already compiled.
  • When you see this error, this means you’re trying to install some package that has an extension module - however the compilation of that source code is not available.
  • “vcvarsall.bat” is part of the compiler that is required to compile the module.
  We will see how to fix this error.  

Solution 1 : 

  • Look for wheels of your respective package in the below link and try to use the wheel while installing the Python package.
https://www.lfd.uci.edu/~gohlke/pythonlibs/

  • Use the below command to install now -

python -m pip install <wheel\_file\_downloaded>

 

Solution 2:

  • Use a different Python distribution e.g. Anaconda - https://www.anaconda.com/products/individual#Downloads
 

Solution 3 :

  • Create a setup.py loading setuptools (Skip using distutils). setuptools will help patch-up and find vcvarsall.bat. Additional infocan be read from official cpython page - http://docs.cython.org/en/latest/src/reference/compilation.html

try:
  from setuptools import setup
  from setuptools import Extension
except ImportError:
  from distutils.core import setup
  from distutils.extension import Extension

 

Solution 4 :

  • Python modules has lots of components written in C or C++.
  • When you install such a Python package with pip (or setup.py), it is required to compile the C/C++ code. By default, pip assumes that you already have the MS Visual C++ compiler installed. But in case if you don't, then this error can occur.
  • So you can install - MS Visual C++ compiler or MinGW and then give it a try.
 

Solution 5 :

  • Try changing the compiler

python setup.py build --compiler=mingw32

  • Then install the package

python setup.py install

Do the steps below if not already done -

  • mingw32's should already be part of the environment PATH variable
e.g. append PATH with C:\programs\mingw\bin

  • Modify distutils.cfg - C:\Python27\Lib\distutils\distutils.cfg -

    \[build\]
    compiler=mingw32
    
  Hope this helps.  

Additional Read -

   


error: Unable to find vcvarsall.bat ,error unable to find vcvarsall.bat ,error unable to find vcvarsall.bat cython ,error unable to find vcvarsall.bat python ,error unable to find vcvarsall.bat anaconda ,error unable to find vcvarsall.bat python 3.5 ,error unable to find vcvarsall.bat python 3.8 ,error unable to find vcvarsall.bat windows 10 ,error unable to find vcvarsall.bat f2py ,building 'jep' extension error unable to find vcvarsall.bat ,building 'pycocotools.\_mask' extension error unable to find vcvarsall.bat ,building 'im2col\_cython' extension error unable to find vcvarsall.bat ,python setup.py build error unable to find vcvarsall.bat ,compiling c sources error unable to find vcvarsall.bat ,error microsoft visual c++ 10.0 is required (unable to find vcvarsall.bat) ,error microsoft visual c++ 9.0 is required (unable to find vcvarsall.bat) ,error microsoft visual c++ 14.0 is required (unable to find vcvarsall.bat) ,distutils error unable to find vcvarsall.bat ,distutils.errors.distutilsplatformerror unable to find vcvarsall.bat ,extension error unable to find vcvarsall.bat ,unable to find vcvarsall.bat ,unable to find vcvarsall.bat python ,error unable to find vcvarsall.bat python 3.7 ,python setup.py install error unable to find vcvarsall.bat ,jep error unable to find vcvarsall.bat ,error unable to find vcvarsall.bat mingw ,distutils.errors.distutilsplatformerror unable to find vcvarsall.bat n' ,error unable to find vcvarsall.bat pycharm ,error unable to find vcvarsall.bat pycocotools ,error unable to find vcvarsall.bat pycrypto ,error unable to find vcvarsall.bat python 3.9 ,python error unable to find vcvarsall.bat ,error unable to find vcvarsall.bat visual studio 2017 ,systemexit error unable to find vcvarsall.bat ,python setup error unable to find vcvarsall.bat ,error setup script exited with error unable to find vcvarsall.bat ,error unable to find vcvarsall.bat vs2019 ,error unable to find vcvarsall.bat windows ,cython windows error unable to find vcvarsall.bat ,python cython error unable to find vcvarsall.bat ,distutils.errors.distutilsplatformerror unable to find vcvarsall.bat python ,python pycrypto error unable to find vcvarsall.bat ,error unable to find vcvarsall.bat python 3 ,python unable to find vcvarsall.bat ,error unable to find vcvarsall.bat ,error unable to find vcvarsall.bat cython ,error unable to find vcvarsall.bat python 3.7 ,error unable to find vcvarsall.bat anaconda ,error unable to find vcvarsall.bat python 2.7 ,error unable to find vcvarsall.bat python 3.5 ,error unable to find vcvarsall.bat windows 10 ,error unable to find vcvarsall.bat f2py ,error unable to find vcvarsall.bat pycharm ,error unable to find vcvarsall.bat pycocotools ,error unable to find vcvarsall.bat ,unable to find vcvarsall.bat ,unable to find vcvarsall.bat cython ,error unable to find vcvarsall.bat python 3.7 ,f2py unable to find vcvarsall.bat ,error unable to find vcvarsall.bat anaconda ,unable to find vcvarsall.bat anaconda ,unable to find vcvarsall.bat python 3.5 ,unable to find vcvarsall.bat python 3.9 ,unable to find vcvarsall.bat windows 10 , ,anaconda error unable to find vcvarsall.bat ,building 'im2col\_cython' extension error unable to find vcvarsall.bat ,building 'jep' extension error unable to find vcvarsall.bat ,building 'pycocotools.\_mask' extension error unable to find vcvarsall.bat ,building 'pyodbc' extension error unable to find vcvarsall.bat ,compiling c sources error unable to find vcvarsall.bat ,cython error unable to find vcvarsall.bat ,cython windows error unable to find vcvarsall.bat ,distutils error unable to find vcvarsall.bat ,distutils.errors.distutilsplatformerror unable to find vcvarsall.bat ,distutils.errors.distutilsplatformerror unable to find vcvarsall.bat n' ,distutils.errors.distutilsplatformerror unable to find vcvarsall.bat python ,error microsoft visual c++ 10.0 is required (unable to find vcvarsall.bat) ,error microsoft visual c++ 14.0 is required (unable to find vcvarsall.bat) ,error microsoft visual c++ 9.0 is required (unable to find vcvarsall.bat) ,error setup script exited with error unable to find vcvarsall.bat ,error unable to find vcvarsall.bat ,error unable to find vcvarsall.bat anaconda ,error unable to find vcvarsall.bat cython ,error unable to find vcvarsall.bat f2py ,error unable to find vcvarsall.bat git ,error unable to find vcvarsall.bat github ,error unable to find vcvarsall.bat group ,error unable to find vcvarsall.bat header ,error unable to find vcvarsall.bat history ,error unable to find vcvarsall.bat hub ,error unable to find vcvarsall.bat key ,error unable to find vcvarsall.bat keyword ,error unable to find vcvarsall.bat linux ,error unable to find vcvarsall.bat location ,error unable to find vcvarsall.bat log ,error unable to find vcvarsall.bat mingw ,error unable to find vcvarsall.bat oracle ,error unable to find vcvarsall.bat pycharm ,error unable to find vcvarsall.bat pycocotools ,error unable to find vcvarsall.bat pycrypto ,error unable to find vcvarsall.bat python ,error unable to find vcvarsall.bat python 2.7 ,error unable to find vcvarsall.bat python 3.5 ,error unable to find vcvarsall.bat python 3.7 ,error unable to find vcvarsall.bat python 3.8 ,error unable to find vcvarsall.bat python 3.9 ,error unable to find vcvarsall.bat query ,error unable to find vcvarsall.bat queue ,error unable to find vcvarsall.bat quiz ,error unable to find vcvarsall.bat tables ,error unable to find vcvarsall.bat ubuntu ,error unable to find vcvarsall.bat update ,error unable to find vcvarsall.bat url ,error unable to find vcvarsall.bat visual studio 2017 ,error unable to find vcvarsall.bat vs2019 ,error unable to find vcvarsall.bat windows ,error unable to find vcvarsall.bat windows 10 ,error unable to find vcvarsall.bat xml ,error unable to find vcvarsall.bat year ,error unable to find vcvarsall.bat youtube ,error unable to find vcvarsall.bat zip ,error unable to find vcvarsall.bat zip file ,error unable to find vcvarsall.bat zone ,error unable to find vcvarsall.bat zoom ,extension error unable to find vcvarsall.bat ,f2py error unable to find vcvarsall.bat ,jep error unable to find vcvarsall.bat ,pip error unable to find vcvarsall.bat ,py2exe error unable to find vcvarsall.bat ,pycrypto error unable to find vcvarsall.bat ,pyodbc error unable to find vcvarsall.bat ,python cython error unable to find vcvarsall.bat ,python error unable to find vcvarsall.bat ,python setup error unable to find vcvarsall.bat ,python setup.py build error unable to find vcvarsall.bat ,python setup.py install error unable to find vcvarsall.bat ,systemexit error unable to find vcvarsall.bat ,unable to find vcvarsall.bat ,unable to find vcvarsall.bat python 2.7 ,unable to find vcvarsall.bat visual studio 2019 ,unable to find vcvarsall.bat windows 10 ,windows error unable to find vcvarsall.bat