在pypy上使用pip安装包的问题 [英] Problems using pip to install packages on Pypy

查看:38
本文介绍了在pypy上使用pip安装包的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 Pypy 更快地运行一组数据转换,但我需要安装 numpy 以便脚本运行不变(显然我可以更改脚本,但这不是重点).我尝试按照文档告诉我的方式使用 pip,但它不起作用.它给了我一个关于没有 Visual Studio 14.1 的错误,理论上我确实有(我安装了尽可能多的可再发行组件,包括 2017 版本,据我所知与 14.1 相同).

I want to use Pypy to run a set of data transformations faster, but I need numpy installed so that the script runs unchanged (obviously I could change the script but that's not the point). I tried using pip as the docs told me to, but it just won't work. It gives me an error about not having Visual Studio 14.1, which I do have theoretically (I installed as many redistributables as you can think of, including the 2017 version, which is the same 14.1 as far as I can tell).

我也知道可以下载模块并执行设置或从 github 克隆它,但是让 pip 工作会很好,因为我有兴趣在不久的将来下载其中的很多.

I'm also aware of the possibility of downloading the module and executing the setup or cloning it from github, but getting pip to work would be nice as I'm interested in downloading quite a few of them in the near future.

不过,我对 Windows 还是很菜,所以如果你知道它为什么不起作用,我会很高兴的.

Still, I'm very noobish when it comes to Windows, so I'll be glad if you have any idea of why it isn't working.

这是我从 Windows Shell 得到的错误和日志:

This is the error and log I get from Windows Shell:

PS C:\WINDOWS\system32>pypy3 -m ensurepip
PS C:\WINDOWS\system32>pypy3 -m pip install numpy
Collecting numpy
  Using cached https://files.pythonhosted.org/packages/b6/d6/be8f975f5322336f62371c9abeb936d592c98c047ad63035f1b38ae08efe/numpy-1.17.3.zip
Installing collected packages: numpy
  Running setup.py install for numpy ... error
    Complete output from command "C:\Program Files (x86)\Pypy\pypy3.6-v7.2.0-win32\pypy3.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\alefe\\AppData\\Local\\Temp\\pip-install-uvuig992\\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\alefe\AppData\Local\Temp\pip-record-xm3lustt\install-record.txt --single-version-externally-managed --compile:
    Running from numpy source directory.

    Note: if you need reliable uninstall behavior, then install
    with pip instead of using `setup.py install`:

      - `pip install .`       (from a git repo or downloaded source
                               release)
      - `pip install numpy`   (last NumPy release on PyPi)


    blas_opt_info:
    blas_mkl_info:
    customize MSVCCompiler
      libraries mkl_rt not found in ['C:\\', 'C:\\Program Files (x86)\\Pypy\\pypy3.6-v7.2.0-win32\\libs']
      NOT AVAILABLE

    blis_info:
    customize MSVCCompiler
      libraries blis not found in ['C:\\', 'C:\\Program Files (x86)\\Pypy\\pypy3.6-v7.2.0-win32\\libs']
      NOT AVAILABLE

    openblas_info:
    customize MSVCCompiler
    customize MSVCCompiler
      libraries openblas not found in ['C:\\', 'C:\\Program Files (x86)\\Pypy\\pypy3.6-v7.2.0-win32\\libs']
    get_default_fcompiler: matching types: '['gnu', 'intelv', 'absoft', 'compaqv', 'intelev', 'gnu95', 'g95', 'intelvem', 'intelem', 'flang']'
    customize GnuFCompiler
    Could not locate executable g77
    Could not locate executable f77
    customize IntelVisualFCompiler
    Could not locate executable ifort
    Could not locate executable ifl
    customize AbsoftFCompiler
    Could not locate executable f90
    customize CompaqVisualFCompiler
    Could not locate executable DF
    customize IntelItaniumVisualFCompiler
    Could not locate executable efl
    customize Gnu95FCompiler
    Could not locate executable gfortran
    Could not locate executable f95
    customize G95FCompiler
    Could not locate executable g95
    customize IntelEM64VisualFCompiler
    customize IntelEM64TFCompiler
    Could not locate executable efort
    Could not locate executable efc
    customize PGroupFlangCompiler
    Could not locate executable flang
    don't know how to compile Fortran code on platform 'nt'
      NOT AVAILABLE

    atlas_3_10_blas_threads_info:
    Setting PTATLAS=ATLAS
    customize MSVCCompiler
      libraries tatlas not found in ['C:\\', 'C:\\Program Files (x86)\\Pypy\\pypy3.6-v7.2.0-win32\\libs']
      NOT AVAILABLE

    atlas_3_10_blas_info:
    customize MSVCCompiler
      libraries satlas not found in ['C:\\', 'C:\\Program Files (x86)\\Pypy\\pypy3.6-v7.2.0-win32\\libs']
      NOT AVAILABLE

    atlas_blas_threads_info:
    Setting PTATLAS=ATLAS
    customize MSVCCompiler
      libraries ptf77blas,ptcblas,atlas not found in ['C:\\', 'C:\\Program Files (x86)\\Pypy\\pypy3.6-v7.2.0-win32\\libs']
      NOT AVAILABLE

    atlas_blas_info:
    customize MSVCCompiler
      libraries f77blas,cblas,atlas not found in ['C:\\', 'C:\\Program Files (x86)\\Pypy\\pypy3.6-v7.2.0-win32\\libs']
      NOT AVAILABLE

    accelerate_info:
      NOT AVAILABLE

    C:\Users\alefe\AppData\Local\Temp\pip-install-uvuig992\numpy\numpy\distutils\system_info.py:690: UserWarning:
        Optimized (vendor) Blas libraries are not found.
        Falls back to netlib Blas library which has worse performance.
        A better performance should be easily gained by switching
        Blas library.
      self.calc_info()
    blas_info:
    customize MSVCCompiler
      libraries blas not found in ['C:\\', 'C:\\Program Files (x86)\\Pypy\\pypy3.6-v7.2.0-win32\\libs']
      NOT AVAILABLE

    C:\Users\alefe\AppData\Local\Temp\pip-install-uvuig992\numpy\numpy\distutils\system_info.py:690: UserWarning:
        Blas (http://www.netlib.org/blas/) libraries not found.
        Directories to search for the libraries can be specified in the
        numpy/distutils/site.cfg file (section [blas]) or by setting
        the BLAS environment variable.
      self.calc_info()
    blas_src_info:
      NOT AVAILABLE

    C:\Users\alefe\AppData\Local\Temp\pip-install-uvuig992\numpy\numpy\distutils\system_info.py:690: UserWarning:
        Blas (http://www.netlib.org/blas/) sources not found.
        Directories to search for the sources can be specified in the
        numpy/distutils/site.cfg file (section [blas_src]) or by setting
        the BLAS_SRC environment variable.
      self.calc_info()
      NOT AVAILABLE

    'svnversion' nÆo \u201a reconhecido como um comando interno
    ou externo, um programa oper vel ou um arquivo em lotes.
    non-existing path in 'numpy\\distutils': 'site.cfg'
    lapack_opt_info:
    lapack_mkl_info:
    customize MSVCCompiler
      libraries mkl_rt not found in ['C:\\', 'C:\\Program Files (x86)\\Pypy\\pypy3.6-v7.2.0-win32\\libs']
      NOT AVAILABLE

    openblas_lapack_info:
    customize MSVCCompiler
    customize MSVCCompiler
      libraries openblas not found in ['C:\\', 'C:\\Program Files (x86)\\Pypy\\pypy3.6-v7.2.0-win32\\libs']
      NOT AVAILABLE

    openblas_clapack_info:
    customize MSVCCompiler
    customize MSVCCompiler
      libraries openblas,lapack not found in ['C:\\', 'C:\\Program Files (x86)\\Pypy\\pypy3.6-v7.2.0-win32\\libs']
      NOT AVAILABLE

    flame_info:
    customize MSVCCompiler
      libraries flame not found in ['C:\\', 'C:\\Program Files (x86)\\Pypy\\pypy3.6-v7.2.0-win32\\libs']
      NOT AVAILABLE

    atlas_3_10_threads_info:
    Setting PTATLAS=ATLAS
    customize MSVCCompiler
      libraries lapack_atlas not found in C:\
    customize MSVCCompiler
      libraries tatlas,tatlas not found in C:\
    customize MSVCCompiler
      libraries lapack_atlas not found in C:\Program Files (x86)\Pypy\pypy3.6-v7.2.0-win32\libs
    customize MSVCCompiler
      libraries tatlas,tatlas not found in C:\Program Files (x86)\Pypy\pypy3.6-v7.2.0-win32\libs
    <class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
      NOT AVAILABLE

    atlas_3_10_info:
    customize MSVCCompiler
      libraries lapack_atlas not found in C:\
    customize MSVCCompiler
      libraries satlas,satlas not found in C:\
    customize MSVCCompiler
      libraries lapack_atlas not found in C:\Program Files (x86)\Pypy\pypy3.6-v7.2.0-win32\libs
    customize MSVCCompiler
      libraries satlas,satlas not found in C:\Program Files (x86)\Pypy\pypy3.6-v7.2.0-win32\libs
    <class 'numpy.distutils.system_info.atlas_3_10_info'>
      NOT AVAILABLE

    atlas_threads_info:
    Setting PTATLAS=ATLAS
    customize MSVCCompiler
      libraries lapack_atlas not found in C:\
    customize MSVCCompiler
      libraries ptf77blas,ptcblas,atlas not found in C:\
    customize MSVCCompiler
      libraries lapack_atlas not found in C:\Program Files (x86)\Pypy\pypy3.6-v7.2.0-win32\libs
    customize MSVCCompiler
      libraries ptf77blas,ptcblas,atlas not found in C:\Program Files (x86)\Pypy\pypy3.6-v7.2.0-win32\libs
    <class 'numpy.distutils.system_info.atlas_threads_info'>
      NOT AVAILABLE

    atlas_info:
    customize MSVCCompiler
      libraries lapack_atlas not found in C:\
    customize MSVCCompiler
      libraries f77blas,cblas,atlas not found in C:\
    customize MSVCCompiler
      libraries lapack_atlas not found in C:\Program Files (x86)\Pypy\pypy3.6-v7.2.0-win32\libs
    customize MSVCCompiler
      libraries f77blas,cblas,atlas not found in C:\Program Files (x86)\Pypy\pypy3.6-v7.2.0-win32\libs
    <class 'numpy.distutils.system_info.atlas_info'>
      NOT AVAILABLE

    lapack_info:
    customize MSVCCompiler
      libraries lapack not found in ['C:\\', 'C:\\Program Files (x86)\\Pypy\\pypy3.6-v7.2.0-win32\\libs']
      NOT AVAILABLE

    C:\Users\alefe\AppData\Local\Temp\pip-install-uvuig992\numpy\numpy\distutils\system_info.py:1712: UserWarning:
        Lapack (http://www.netlib.org/lapack/) libraries not found.
        Directories to search for the libraries can be specified in the
        numpy/distutils/site.cfg file (section [lapack]) or by setting
        the LAPACK environment variable.
      if getattr(self, '_calc_info_{}'.format(lapack))():
    lapack_src_info:
      NOT AVAILABLE

    C:\Users\alefe\AppData\Local\Temp\pip-install-uvuig992\numpy\numpy\distutils\system_info.py:1712: UserWarning:
        Lapack (http://www.netlib.org/lapack/) sources not found.
        Directories to search for the sources can be specified in the
        numpy/distutils/site.cfg file (section [lapack_src]) or by setting
        the LAPACK_SRC environment variable.
      if getattr(self, '_calc_info_{}'.format(lapack))():
      NOT AVAILABLE

    C:\Program Files (x86)\Pypy\pypy3.6-v7.2.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": https://visualstudio.microsoft.com/downloads/

    ----------------------------------------
Command ""C:\Program Files (x86)\Pypy\pypy3.6-v7.2.0-win32\pypy3.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\alefe\\AppData\\Local\\Temp\\pip-install-uvuig992\\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\alefe\AppData\Local\Temp\pip-record-xm3lustt\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\alefe\AppData\Local\Temp\pip-install-uvuig992\numpy\

升级:我设法使用 pip 安装了 sympy,没有任何问题.我也可以使用 mattip 描述的方法安装 numpy.尽管如此,大多数软件包仍会出现 Microsoft Visual 错误或类似错误.

Upgrade: I managed to install sympy using pip without any problems. I could also install numpy using the method described by mattip. Still, most packages keep giving me the Microsoft Visual error or a similar one.

推荐答案

pip 既可以安装二进制编译包,也可以下载并编译包的源代码.但是它不能在没有编译器的情况下从源代码编译.要么

pip can install either a binary compiled package or can download and compile the source code of the package. But it cannot compile from source without a compiler. Either

  • 安装编译器并学习从源代码构建 c 扩展模块(不推荐)

  • 如果没有二进制文件,总是使用 pip install --only-binary :all: 强制 pip 失败
  • always use pip install --only-binary :all: <package> to force pip to fail if there is no binary

您可以在 https://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy,您需要名称中包含 pp372 的那些(PyPY 为 pp,python 3 为 3,pypy 7.2.x 为 72)

You can find binary wheels for windows at https://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy, you need the ones that have a pp372 in the name (pp for PyPY, 3 for python 3, 72 for pypy 7.2.x)

这篇关于在pypy上使用pip安装包的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆