I have a working Python 3.6 Version installed and wanted to try out PyPy for a heuristic algorithm. I installed PyPy using this guide: How to use PyPy on Windows? and got it to run and also install e.g. the openpyxl module via: pypy3 -m pip install openpyxl
However, when trying to install numpy or pandas I get the following error messsage:
"error: Microsoft Visual C++ 14.1 is required. Get it with Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/"
I tried all of the following solutions: Microsoft Visual C++ 14.0 is required (Unable to find vcvarsall.bat) namely:
- Updated Setuptools
pypy3 -m pip install --upgrade setuptools
- Installed various kinds of Microsoft Visual Studio/Build Tools as mentioned in the comments of that question.
- Tried to install numpy using the binary only option
pypy3 -m pip install --only-binary :all:numpy
- Tried updating setuptools and installing numpy from the VS command prompt.
None of these worked for me. The best I came up with was that it might have to do with the environment variables. In the PyPy doc (http://doc.pypy.org/en/latest/windows.html) it says:
"The installation will set the VS140COMNTOOLS environment variable, this is key to distutils/setuptools finding the compiler"
I could not find this variable in the Systemvariables or Uservariables. So I tried making a new SYSTEMVARIABLE with name = VS140COMNTOOLS and Value = C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools. That is the path where on my machine the VsDevCmd.bat is located, which I think is responsible for setting the environment variable during installation of Microsoft Visual Studio.
This did change my error message but only made it worse/longer. Also, when I type python
or pypy3
in my command prompt I get the following:
!https://i.stack.imgur.com/vcGmJ.jpg
Which according to this post What is the difference between these two lines, MSC v.1900 64 bit (AMD64) and MSC v.1914 32 bit (Intel) show that I have a C++ compiler installed?
My questions are:
- Does the Name of the environmental variable ("VS140COMNTOOLS") matter? I assume it is for VisualStudio14 but the Value leads to VisualStudio19.
- Is it right to use a SYSTEMVARIABLE and not a USER VARIABLE to point to the compiler?
- If I need Microsoft Visual C++ 14.1, are/should all newer versions also be feasible?
- Is my environmental variable actually pointing to the right directory? What needs to be in such a directory to make PyPy recognize a C++ compiler?
- Why do I have to type
pypy3 -m pip install <Package>
? instead ofpypy3 pip install <Package>
which only results in a "FilenotFoundError"? - How do i get PyPy to recognize the compiler and install numpy or pandas correctly?
EDIT 1
Using the "x86 Native Tools Command Prompt for VS 2019" and trying pypy3 -m pip install numpy
did not work. I also found this question how can I install numpy on pypy on my 64 bit computer running Windows 64 bit? and since I could not find the respective environmental variable:
I set it using
set VS140COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build"
and tried both: pypy3 -m pip install numpy
and pypy3 -m pip install numpy -v
. Sadly, that also did not resolve the issue and the error message still is: and later on saying that no Microsoft Visual C++ 14.1 is installed.
The error message points out it does not find several libraries in my PyPy/libs folder. Does anyone know what I need to install that it finds these libraries?
@mattip Speed does not really matter in my case, since I actually don't use numpy for calculations. However I use pandas for data storage which requires numpy to be installed first.
Is it easier to install PyPy in a virtual environment, or will I face the same issues there?