0

hardware/software: Machine 64 AMD processor running 64 bit windows

I have a computationally heavy program that I wish to speed up by using Pypy. I have installed pypy and also installed Microsoft Visual Studio and Microsoft Visual C++ Build Tools.

My python program uses Numpy so I tried to install numpy on pypy using the following

pypy3 - m pip install numpy

The error message I get says:

error: Microsoft Visual C++ 14.1 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

However I have already installed Microsoft Visual C++ Build Tools? I reinstalled it several times but got the same results.

How can I successfully install numpy for pypy3?

command used :

pypy3 - m pip install numpy

I expect numpy to be installed on PYPY but the results I get are:

  c:\pypy\pypy3.6-v7.0.0-win32\lib-python\3\distutils\dist.py:261: UserWarning: Unknown distribution option: 'define_macros'
      warnings.warn(msg)
    running install
    running build
    running config_cc
    unifing config_cc, config, build_clib, build_ext, build commands --compiler options
    running config_fc
    unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
    running build_src
    build_src
    building py_modules sources
    creating build
    creating build\src.win32-3.6
    creating build\src.win32-3.6\numpy
    creating build\src.win32-3.6\numpy\distutils
    building library "npymath" sources
    error: Microsoft Visual C++ 14.1 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

1 Answers1

0

You might need to run pypy3 -mpip install --upgrade setuptools to get a version of setuptools that can find your build tools. You can also pypy3 to use your version of the build tools by running pypy3 from a developer command prompt, be sure to choose the 32-bit version of the developer tools (pypy on windows is not available in a 64-bit version)

mattip
  • 2,360
  • 1
  • 13
  • 13
  • Thanks setuptools installed ok but when I type pypy3 - m pip install numpy I get c:\pypy\pypy3.6-v7.0.0-win32>pypy3 - m pip install numpy Python 3.6.1 (dab365a46514, Feb 06 2019, 12:26:18) [PyPy 7.0.0-alpha0 with MSC v.1910 32 bit] on win32 Type "help", "copyright", "credits" or "license" for more information. And now for something completely different: ``what we achieved today: we discussed the ponyness of time-machines'' >>>> I do not know why I am getting a command prompt. I expected numpy to be installed? – Peter Berrett Mar 24 '19 at 10:10
  • '-m' not `- m`. Remove the extra space. – mattip Mar 25 '19 at 11:21
  • I removed the space. This was the result. Command "c:\pypy\pypy3.6-v7.0.0-win32\pypy3.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\pberr\\AppData\\Local\\Temp\\pip-build-vqgy2_nd\\numpy\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\pberr\AppData\Local\Temp\pip-qlzlga4a-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\pberr\AppData\Local\Temp\pip-build-vqgy2_nd\numpy\ – Peter Berrett Mar 26 '19 at 12:57
  • It seems I needed to "set VS140COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build" in order to allow pypy to find msvc. – mattip Mar 27 '19 at 17:11
  • You need to use a cmd.exe window. You can either use the one from visual studio cmd prompt for the 32 bit tool. or open a new cmd.exe, and type`set VS140COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build`, then `path\to\pypy3.xe -mpip install numpy` – mattip Mar 31 '19 at 06:47
  • Commands accepted ok then tried pypy3 -m pip install numpy and got Command "C:\pypy\pypy3.6-v7.0.0-win32\pypy3.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\pberr\\AppData\\Local\\Temp\\pip-build-eooclxqh\\numpy\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\pberr\AppData\Local\Temp\pip-eo25xsna-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\pberr\AppData\Local\Temp\pip-build-eooclxqh\numpy\ – Peter Berrett Apr 01 '19 at 07:30
  • pypy3 -m pip install numpy -v – mattip Apr 02 '19 at 08:25