错误:pip安装scipy

7

我在我的Oracle Linux上安装了Python 2.6.6。

我运行了安装软件包的命令。

pip install scipy

然而我得到了以下错误。
[root@bigdatadev3 Downloads]# pip install scipy
    DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6
    Collecting scipy
      Using cached scipy-0.18.1.tar.gz
    Building wheels for collected packages: scipy
      Running setup.py bdist_wheel for scipy ... error
      Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-zu4ibh/scipy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpDdmSFupip-wheel- --python-tag cp26:
      usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
         or: -c --help [cmd1 cmd2 ...]
         or: -c --help-commands
         or: -c cmd --help

      error: invalid command 'bdist_wheel'

      ----------------------------------------
      Failed building wheel for scipy
      Running setup.py clean for scipy
      Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-zu4ibh/scipy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" clean --all:

      `setup.py clean` is not supported, use one of the following instead:

        - `git clean -xdf` (cleans all files)
        - `git clean -Xdf` (cleans all versioned files, doesn't touch
                    files that aren't checked into the git repo)

      Add `--force` to your command to use it anyway if you must (unsupported).


      ----------------------------------------
      Failed cleaning build dir for scipy
    Failed to build scipy
    Installing collected packages: scipy
      Running setup.py install for scipy ... error
        Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-zu4ibh/scipy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-RLPNZW-record/install-record.txt --single-version-externally-managed --compile:

        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 scipy`   (last SciPy release on PyPI)


        lapack_opt_info:
        openblas_lapack_info:
          libraries openblas not found in ['/usr/local/lib64', '/usr/local/lib', '/usr/lib64', '/usr/lib']
          NOT AVAILABLE

        lapack_mkl_info:
          libraries mkl_rt not found in ['/usr/local/lib64', '/usr/local/lib', '/usr/lib64', '/usr/lib']
          NOT AVAILABLE

        atlas_3_10_threads_info:
        Setting PTATLAS=ATLAS
          libraries tatlas,tatlas not found in /usr/local/lib64
          libraries lapack_atlas not found in /usr/local/lib64
          libraries tatlas,tatlas not found in /usr/local/lib
          libraries lapack_atlas not found in /usr/local/lib
          libraries tatlas,tatlas not found in /usr/lib64/sse2
          libraries lapack_atlas not found in /usr/lib64/sse2
          libraries tatlas,tatlas not found in /usr/lib64
          libraries lapack_atlas not found in /usr/lib64
          libraries tatlas,tatlas not found in /usr/lib
          libraries lapack_atlas not found in /usr/lib
        <class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
          NOT AVAILABLE

        atlas_3_10_info:
          libraries satlas,satlas not found in /usr/local/lib64
          libraries lapack_atlas not found in /usr/local/lib64
          libraries satlas,satlas not found in /usr/local/lib
          libraries lapack_atlas not found in /usr/local/lib
          libraries satlas,satlas not found in /usr/lib64/sse2
          libraries lapack_atlas not found in /usr/lib64/sse2
          libraries satlas,satlas not found in /usr/lib64
          libraries lapack_atlas not found in /usr/lib64
          libraries satlas,satlas not found in /usr/lib
          libraries lapack_atlas not found in /usr/lib
        <class 'numpy.distutils.system_info.atlas_3_10_info'>
          NOT AVAILABLE

        atlas_threads_info:
        Setting PTATLAS=ATLAS
          libraries ptf77blas,ptcblas,atlas not found in /usr/local/lib64
          libraries lapack_atlas not found in /usr/local/lib64
          libraries ptf77blas,ptcblas,atlas not found in /usr/local/lib
          libraries lapack_atlas not found in /usr/local/lib
          libraries ptf77blas,ptcblas,atlas not found in /usr/lib64/sse2
          libraries lapack_atlas not found in /usr/lib64/sse2
          libraries ptf77blas,ptcblas,atlas not found in /usr/lib64
          libraries lapack_atlas not found in /usr/lib64
          libraries ptf77blas,ptcblas,atlas not found in /usr/lib
          libraries lapack_atlas not found in /usr/lib
        <class 'numpy.distutils.system_info.atlas_threads_info'>
          NOT AVAILABLE

        atlas_info:
          libraries f77blas,cblas,atlas not found in /usr/local/lib64
          libraries lapack_atlas not found in /usr/local/lib64
          libraries f77blas,cblas,atlas not found in /usr/local/lib
          libraries lapack_atlas not found in /usr/local/lib
          libraries f77blas,cblas,atlas not found in /usr/lib64/sse2
          libraries lapack_atlas not found in /usr/lib64/sse2
          libraries f77blas,cblas,atlas not found in /usr/lib64
          libraries lapack_atlas not found in /usr/lib64
          libraries f77blas,cblas,atlas not found in /usr/lib
          libraries lapack_atlas not found in /usr/lib
        <class 'numpy.distutils.system_info.atlas_info'>
          NOT AVAILABLE

        /usr/lib64/python2.6/site-packages/numpy-1.11.3-py2.6-linux-x86_64.egg/numpy/distutils/system_info.py:1532: UserWarning:
        Atlas (http://math-atlas.sourceforge.net/) libraries not found.
        Directories to search for the libraries can be specified in the
        numpy/distutils/site.cfg file (section [atlas]) or by setting
        the ATLAS environment variable.
          warnings.warn(AtlasNotFoundError.__doc__)
        lapack_info:
          libraries lapack not found in ['/usr/local/lib64', '/usr/local/lib', '/usr/lib64', '/usr/lib']
          NOT AVAILABLE

        /usr/lib64/python2.6/site-packages/numpy-1.11.3-py2.6-linux-x86_64.egg/numpy/distutils/system_info.py:1543: 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.
          warnings.warn(LapackNotFoundError.__doc__)
        lapack_src_info:
          NOT AVAILABLE

        /usr/lib64/python2.6/site-packages/numpy-1.11.3-py2.6-linux-x86_64.egg/numpy/distutils/system_info.py:1546: 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.
          warnings.warn(LapackSrcNotFoundError.__doc__)
          NOT AVAILABLE

        Running from scipy source directory.
        Traceback (most recent call last):
          File "<string>", line 1, in <module>
          File "/tmp/pip-build-zu4ibh/scipy/setup.py", line 415, in <module>
        setup_package()
          File "/tmp/pip-build-zu4ibh/scipy/setup.py", line 411, in setup_package
        setup(**metadata)
          File "/usr/lib64/python2.6/site-packages/numpy-1.11.3-py2.6-linux-x86_64.egg/numpy/distutils/core.py", line 135, in setup
        config = configuration()
          File "/tmp/pip-build-zu4ibh/scipy/setup.py", line 335, in configuration
        config.add_subpackage('scipy')
          File "/usr/lib64/python2.6/site-packages/numpy-1.11.3-py2.6-linux-x86_64.egg/numpy/distutils/misc_util.py", line 1000, in add_subpackage
        caller_level = 2)
          File "/usr/lib64/python2.6/site-packages/numpy-1.11.3-py2.6-linux-x86_64.egg/numpy/distutils/misc_util.py", line 969, in get_subpackage
        caller_level = caller_level + 1)
          File "/usr/lib64/python2.6/site-packages/numpy-1.11.3-py2.6-linux-x86_64.egg/numpy/distutils/misc_util.py", line 906, in _get_configuration_from_setup_py
        config = setup_module.configuration(*args)
          File "scipy/setup.py", line 15, in configuration
        config.add_subpackage('linalg')
          File "/usr/lib64/python2.6/site-packages/numpy-1.11.3-py2.6-linux-x86_64.egg/numpy/distutils/misc_util.py", line 1000, in add_subpackage
        caller_level = 2)
          File "/usr/lib64/python2.6/site-packages/numpy-1.11.3-py2.6-linux-x86_64.egg/numpy/distutils/misc_util.py", line 969, in get_subpackage
        caller_level = caller_level + 1)
          File "/usr/lib64/python2.6/site-packages/numpy-1.11.3-py2.6-linux-x86_64.egg/numpy/distutils/misc_util.py", line 906, in _get_configuration_from_setup_py
        config = setup_module.configuration(*args)
          File "scipy/linalg/setup.py", line 20, in configuration
        raise NotFoundError('no lapack/blas resources found')
        numpy.distutils.system_info.NotFoundError: no lapack/blas resources found

        ----------------------------------------
    Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-zu4ibh/scipy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-RLPNZW-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-zu4ibh/scipy/

我在这里错过了什么?

问题已解决

我按照以下方式解决了问题:

  • 运行 yum install lapackyum install blas-devel lapack-devel
  • 运行 pip install scipy

执行 Running setup.py install for scipy ... 花费了一些时间,但最终已经安装完成。


1
尝试更新pip。 - Mike Müller
1
升级Python,就像它建议的那样。确保使用pip install wheel安装了wheel并且它是最新版本。这会做什么? - moopet
我无法升级我的Python,我必须使用2.6.6版本。 - Hardik Gupta
您IP地址为143.198.54.68,由于运营成本限制,当前对于免费用户的使用频率限制为每个IP每72小时10次对话,如需解除限制,请点击左下角设置图标按钮(手机用户先点击左上角菜单按钮)。 - Mike Müller
1
不论Python版本过时或无法构建wheel,都不应该阻止你构建scipy。 你主要的问题是系统中缺少所需的依赖项。我不熟悉这个发行版,但你需要安装lapackatlas中的其中一个 - 尝试使用你的软件包管理器安装它们。 - Simon Walker
显示剩余3条评论
1个回答

5

问题已解决

我按照以下步骤解决了问题:

  • 运行yum install lapackyum install blas-devel lapack-devel
  • 运行pip install scipy

执行Running setup.py install for scipy ...花费了一些时间,但最终安装成功。


1
我需要安装更多的Ubuntu软件包,但是这对我来说似乎有效:sudo apt-get install python-numpy python-scipy libzmq-dev libblas-dev liblapack-dev libatlas-dev gfortran - blambert

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接