【问题标题】:how can I install numpy on pypy on my 64 bit computer running Windows 64 bit?如何在运行 Windows 64 位的 64 位计算机上的 pypy 上安装 numpy?
【发布时间】:2019-03-23 04:15:22
【问题描述】:

硬件/软件: 运行 64 位窗口的机器 64 AMD 处理器

我有一个计算量很大的程序,我希望使用 Pypy 来加速它。我已经安装了 pypy,还安装了 Microsoft Visual Studio 和 Microsoft Visual C++ Build Tools。

我的 python 程序使用 Numpy,所以我尝试使用以下方法在 pypy 上安装 numpy

pypy3 - m pip install numpy

我收到的错误消息是:

错误:需要 Microsoft Visual C++ 14.1。使用“Microsoft Visual C++ Build Tools”获取它:http://landinghub.visualstudio.com/visual-cpp-build-tools

但是我已经安装了 Microsoft Visual C++ Build Tools?我重新安装了几次,但得到了相同的结果。

如何成功安装 numpy for pypy3?

使用的命令:

pypy3 - m pip install numpy

我希望在 PYPY 上安装 numpy,但我得到的结果是:

  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

【问题讨论】:

    标签: numpy pypy


    【解决方案1】:

    您可能需要运行 pypy3 -mpip install --upgrade setuptools 以获取可以找到您的构建工具的 setuptools 版本。您还可以通过在开发人员命令提示符下运行 pypy3 来使用您的构建工具版本,请务必选择 32 位版本的开发人员工具(Windows 上的 pypy 在 64 位版本中不可用)

    【讨论】:

    • 感谢 setuptools 安装正常但是当我输入 pypy3 - m pip install numpy 我得到 c:\pypy\pypy3.6-v7.0.0-win32>pypy3 - m pip install numpy Python 3.6.1 ( dab365a46514,2019 年 2 月 6 日,12:26:18) [PyPy 7.0.0-alpha0 with MSC v.1910 32 bit] on win32 键入“帮助”、“版权”、“信用”或“许可证”以获取更多信息。现在来点完全不同的东西:“我们今天取得的成就:我们讨论了时间机器的小马”>>>>我不知道为什么我会收到命令提示符。我希望安装 numpy?
    • '-m' 不是- m。删除多余的空间。
    • 我删除了空间。这就是结果。命令 "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" 在 C:\Users\pberr\AppData\Local\Temp\ 中出现错误代码 1 失败pip-build-vqgy2_nd\numpy\
    • 看来我需要“设置 VS140COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build”才能让 pypy 找到 msvc。
    • 您需要使用 cmd.exe 窗口。您可以使用来自 Visual Studio cmd 提示符的 32 位工具。或者打开一个新的cmd.exe,输入set VS140COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build,然后输入path\to\pypy3.xe -mpip install numpy
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-10-12
    • 1970-01-01
    • 1970-01-01
    • 2010-12-03
    • 2012-06-13
    • 2011-04-08
    • 2017-06-08
    相关资源
    最近更新 更多