使用Python 2.7.6在Ubuntu 14.04上安装scipy时出错

时间:2016-01-07 19:40:58

标签: python ubuntu scipy vagrant

在Vagrant Ubuntu 14.04和Python 2.7.6中运行时遇到此问题。我还没有尝试过VMware VM,我认为这不是问题所在。

sudo pip install scipy

这是执行cat /home/vagrant/.pip/pip.log

时的错误日志
------------------------------------------------------------
/usr/bin/pip run on Thu Jan  7 19:31:44 2016
Downloading/unpacking scipy
  Getting page https://pypi.python.org/simple/scipy/
  URLs to search for versions for scipy:
  * https://pypi.python.org/simple/scipy/
  Analyzing links from page https://pypi.python.org/simple/scipy/

    Found link https://pypi.python.org/packages/source/s/scipy/scipy-0.10.0.tar.gz#md5=e357c08425fd031dce63bc4905789088 (from https://pypi.python.org/simple/scipy/), version: 0.10.0
    Found link https://pypi.python.org/packages/source/s/scipy/scipy-0.10.0.zip#md5=d1a4242266739433dcfe2096b0ab4007 (from https://pypi.python.org/simple/scipy/), version: 0.10.0
    Found link https://pypi.python.org/packages/source/s/scipy/scipy-0.10.1.tar.gz#md5=6ad976549e22e04ca93e70cf55b70a22 (from https://pypi.python.org/simple/scipy/), version: 0.10.1
    Found link https://pypi.python.org/packages/source/s/scipy/scipy-0.10.1.zip#md5=4156cc1b765eb186de9518a94b6c3518 (from https://pypi.python.org/simple/scipy/), version: 0.10.1
    Found link https://pypi.python.org/packages/source/s/scipy/scipy-0.11.0.tar.gz#md5=842c81d35fd63579c41a8ca21a2419b9 (from https://pypi.python.org/simple/scipy/), version: 0.11.0
    Found link https://pypi.python.org/packages/source/s/scipy/scipy-0.11.0.zip#md5=40b700ddde9ddab643b640fff7a9d753 (from https://pypi.python.org/simple/scipy/), version: 0.11.0
    Found link https://pypi.python.org/packages/source/s/scipy/scipy-0.12.0.tar.gz#md5=8fb4da324649f655e8557ea92b998786 (from https://pypi.python.org/simple/scipy/), version: 0.12.0
    Found link https://pypi.python.org/packages/source/s/scipy/scipy-0.12.0.zip#md5=e4b9f3cb2e965fc8751faedfb9164d08 (from https://pypi.python.org/simple/scipy/), version: 0.12.0
    Found link https://pypi.python.org/packages/source/s/scipy/scipy-0.12.1.tar.gz#md5=906278290152fedfe79029371ca584a5 (from https://pypi.python.org/simple/scipy/), version: 0.12.1
    Found link https://pypi.python.org/packages/source/s/scipy/scipy-0.12.1.zip#md5=3f23065fc45152c92c3588dad2f20c62 (from https://pypi.python.org/simple/scipy/), version: 0.12.1
    Found link https://pypi.python.org/packages/source/s/scipy/scipy-0.13.0.tar.gz#md5=ffa1e9bfd2bbdf3f17f4cf8139084098 (from https://pypi.python.org/simple/scipy/), version: 0.13.0
    Found link https://pypi.python.org/packages/source/s/scipy/scipy-0.13.0.zip#md5=bd588ce8255e4d5427b5b19e9da2d4c7 (from https://pypi.python.org/simple/scipy/), version: 0.13.0
    Found link https://pypi.python.org/packages/source/s/scipy/scipy-0.13.1.tar.gz#md5=e082fe358a2b39cff235e5af4240f5a5 (from https://pypi.python.org/simple/scipy/), version: 0.13.1
    Found link https://pypi.python.org/packages/source/s/scipy/scipy-0.13.1.zip#md5=485411032b02583b4eb63caec6f2a916 (from https://pypi.python.org/simple/scipy/), version: 0.13.1
    Found link https://pypi.python.org/packages/source/s/scipy/scipy-0.13.2.tar.gz#md5=fcd110802b0bf3505ba567cf831566e1 (from https://pypi.python.org/simple/scipy/), version: 0.13.2
    Found link https://pypi.python.org/packages/source/s/scipy/scipy-0.13.2.zip#md5=9befa30e546fba762a0c1695a509f731 (from https://pypi.python.org/simple/scipy/), version: 0.13.2
    Found link https://pypi.python.org/packages/source/s/scipy/scipy-0.13.3.tar.gz#md5=0547c1f8e8afad4009cc9b5ef17a2d4d (from https://pypi.python.org/simple/scipy/), version: 0.13.3
    Found link https://pypi.python.org/packages/source/s/scipy/scipy-0.13.3.zip#md5=20ff3a867cc5925ef1d654aed2ff7e88 (from https://pypi.python.org/simple/scipy/), version: 0.13.3
    Found link https://pypi.python.org/packages/source/s/scipy/scipy-0.14.0.tar.gz#md5=d7c7f4ccf8b07b08d6fe49d5cd51f85d (from https://pypi.python.org/simple/scipy/), version: 0.14.0
    Found link https://pypi.python.org/packages/source/s/scipy/scipy-0.14.0.zip#md5=7ee4fa9e756bab6b46b79f77c821cb68 (from https://pypi.python.org/simple/scipy/), version: 0.14.0
    Found link https://pypi.python.org/packages/source/s/scipy/scipy-0.14.1.tar.gz#md5=1bfedd3197b3e3f8cd131ae2c06a1bf5 (from https://pypi.python.org/simple/scipy/), version: 0.14.1
    Found link https://pypi.python.org/packages/source/s/scipy/scipy-0.14.1.zip#md5=4bfc35d3683e0ef397157f84040df5b0 (from https://pypi.python.org/simple/scipy/), version: 0.14.1
    Found link https://pypi.python.org/packages/source/s/scipy/scipy-0.15.0.tar.gz#md5=639112f077f0aeb6d80718dc5019dc7a (from https://pypi.python.org/simple/scipy/), version: 0.15.0
    Found link https://pypi.python.org/packages/source/s/scipy/scipy-0.15.0.zip#md5=09641b11ac17f1c141979c60a3f60895 (from https://pypi.python.org/simple/scipy/), version: 0.15.0
    Found link https://pypi.python.org/packages/source/s/scipy/scipy-0.15.1.tar.gz#md5=be56cd8e60591d6332aac792a5880110 (from https://pypi.python.org/simple/scipy/), version: 0.15.1
    Found link https://pypi.python.org/packages/source/s/scipy/scipy-0.15.1.zip#md5=0bd8aa1133118abc77d0d69cc2777ef3 (from https://pypi.python.org/simple/scipy/), version: 0.15.1
    Found link https://pypi.python.org/packages/source/s/scipy/scipy-0.16.0.tar.gz#md5=eb95dda0f36cc3096673993a350cde77 (from https://pypi.python.org/simple/scipy/), version: 0.16.0
    Found link https://pypi.python.org/packages/source/s/scipy/scipy-0.16.0.zip#md5=1764bd452a72698b968ad13e51e28053 (from https://pypi.python.org/simple/scipy/), version: 0.16.0
    Found link https://pypi.python.org/packages/source/s/scipy/scipy-0.16.1.tar.gz#md5=967cdb8588a4249f820344d8264a2143 (from https://pypi.python.org/simple/scipy/), version: 0.16.1
    Found link https://pypi.python.org/packages/source/s/scipy/scipy-0.16.1.zip#md5=f473f9cd366daf4106003accff32c25f (from https://pypi.python.org/simple/scipy/), version: 0.16.1
    Found link https://pypi.python.org/packages/source/s/scipy/scipy-0.8.0.tar.gz#md5=f0bfc6141b90e6a31555b31486602251 (from https://pypi.python.org/simple/scipy/), version: 0.8.0
    Found link https://pypi.python.org/packages/source/s/scipy/scipy-0.9.0.tar.gz#md5=ebfef6e8e82d15c875a4ee6a46d4e1cd (from https://pypi.python.org/simple/scipy/), version: 0.9.0
    Found link https://pypi.python.org/packages/source/s/scipy/scipy-0.9.0.zip#md5=a37933c9e3c4fdf8d087624cd7dcb47d (from https://pypi.python.org/simple/scipy/), version: 0.9.0
  Using version 0.16.1 (newest of versions: 0.16.1, 0.16.1, 0.16.0, 0.16.0, 0.15.1, 0.15.1, 0.15.0, 0.15.0, 0.14.1, 0.14.1, 0.14.0, 0.14.0, 0.13.3, 0.13.3, 0.13.2, 0.13.2, 0.13.1, 0.13.1, 0.13.0, 0.13.0, 0.12.1, 0.12.1, 0.12.0, 0.12.0, 0.11.0, 0.11.0, 0.10.1, 0.10.1, 0.10.0, 0.10.0, 0.9.0, 0.9.0, 0.8.0)
  Downloading from URL https://pypi.python.org/packages/source/s/scipy/scipy-0.16.1.tar.gz#md5=967cdb8588a4249f820344d8264a2143 (from https://pypi.python.org/simple/scipy/)
  Running setup.py (path:/tmp/pip_build_root/scipy/setup.py) egg_info for package scipy
    running egg_info
    creating pip-egg-info/scipy.egg-info
    writing pip-egg-info/scipy.egg-info/PKG-INFO
    writing top-level names to pip-egg-info/scipy.egg-info/top_level.txt
    writing dependency_links to pip-egg-info/scipy.egg-info/dependency_links.txt
    writing manifest file 'pip-egg-info/scipy.egg-info/SOURCES.txt'
    warning: manifest_maker: standard file '-c' not found

    reading manifest file 'pip-egg-info/scipy.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no previously-included files matching '*_subr_*.f' found under directory 'scipy/linalg/src/id_dist/src'
    no previously-included directories found matching 'benchmarks/env'
    no previously-included directories found matching 'benchmarks/results'
    no previously-included directories found matching 'benchmarks/html'
    no previously-included directories found matching 'benchmarks/scipy'
    no previously-included directories found matching 'scipy/special/tests/data/boost'
    no previously-included directories found matching 'scipy/special/tests/data/gsl'
    no previously-included directories found matching 'doc/build'
    no previously-included directories found matching 'doc/source/generated'
    no previously-included directories found matching '*/__pycache__'
    warning: no previously-included files matching '*~' found anywhere in distribution
    warning: no previously-included files matching '*.bak' found anywhere in distribution
    warning: no previously-included files matching '*.swp' found anywhere in distribution
    warning: no previously-included files matching '*.pyo' found anywhere in distribution
    writing manifest file 'pip-egg-info/scipy.egg-info/SOURCES.txt'
  Source in /tmp/pip_build_root/scipy has version 0.16.1, which satisfies requirement scipy
Installing collected packages: scipy
  Running setup.py install for scipy
    Running command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/scipy/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-6DMxsQ-record/install-record.txt --single-version-externally-managed --compile
    lapack_opt_info:
    openblas_info:
      libraries  not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/i386-linux-gnu']
      NOT AVAILABLE

    lapack_mkl_info:
    mkl_info:
      libraries mkl,vml,guide not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/i386-linux-gnu']
      NOT AVAILABLE

      NOT AVAILABLE

    atlas_threads_info:
    Setting PTATLAS=ATLAS
      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/lib/sse2
      libraries lapack_atlas not found in /usr/lib/sse2
      libraries ptf77blas,ptcblas,atlas not found in /usr/lib
      libraries lapack_atlas not found in /usr/lib
      libraries ptf77blas,ptcblas,atlas not found in /usr/lib/i386-linux-gnu
      libraries lapack_atlas not found in /usr/lib/i386-linux-gnu
    numpy.distutils.system_info.atlas_threads_info
      NOT AVAILABLE

    atlas_info:
      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/lib/sse2
      libraries lapack_atlas not found in /usr/lib/sse2
      libraries f77blas,cblas,atlas not found in /usr/lib
      libraries lapack_atlas not found in /usr/lib
      libraries f77blas,cblas,atlas not found in /usr/lib/i386-linux-gnu
      libraries lapack_atlas not found in /usr/lib/i386-linux-gnu
    numpy.distutils.system_info.atlas_info
      NOT AVAILABLE

    /usr/lib/python2.7/dist-packages/numpy/distutils/system_info.py:1427: 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/lib', '/usr/lib', '/usr/lib/i386-linux-gnu']
      NOT AVAILABLE

    /usr/lib/python2.7/dist-packages/numpy/distutils/system_info.py:1438: 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/lib/python2.7/dist-packages/numpy/distutils/system_info.py:1441: 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_root/scipy/setup.py", line 253, in <module>
        setup_package()
      File "/tmp/pip_build_root/scipy/setup.py", line 250, in setup_package
        setup(**metadata)
      File "/usr/lib/python2.7/dist-packages/numpy/distutils/core.py", line 135, in setup
        config = configuration()
      File "/tmp/pip_build_root/scipy/setup.py", line 175, in configuration
        config.add_subpackage('scipy')
      File "/usr/lib/python2.7/dist-packages/numpy/distutils/misc_util.py", line 966, in add_subpackage
        caller_level = 2)
      File "/usr/lib/python2.7/dist-packages/numpy/distutils/misc_util.py", line 935, in get_subpackage
        caller_level = caller_level + 1)
      File "/usr/lib/python2.7/dist-packages/numpy/distutils/misc_util.py", line 872, 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/lib/python2.7/dist-packages/numpy/distutils/misc_util.py", line 966, in add_subpackage
        caller_level = 2)
      File "/usr/lib/python2.7/dist-packages/numpy/distutils/misc_util.py", line 935, in get_subpackage
        caller_level = caller_level + 1)
      File "/usr/lib/python2.7/dist-packages/numpy/distutils/misc_util.py", line 872, 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
    Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/scipy/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-6DMxsQ-record/install-record.txt --single-version-externally-managed --compile:
    lapack_opt_info:

openblas_info:

  libraries  not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/i386-linux-gnu']

  NOT AVAILABLE



lapack_mkl_info:

mkl_info:

  libraries mkl,vml,guide not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/i386-linux-gnu']

  NOT AVAILABLE



  NOT AVAILABLE



atlas_threads_info:

Setting PTATLAS=ATLAS

  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/lib/sse2

  libraries lapack_atlas not found in /usr/lib/sse2

  libraries ptf77blas,ptcblas,atlas not found in /usr/lib

  libraries lapack_atlas not found in /usr/lib

  libraries ptf77blas,ptcblas,atlas not found in /usr/lib/i386-linux-gnu

  libraries lapack_atlas not found in /usr/lib/i386-linux-gnu

numpy.distutils.system_info.atlas_threads_info

  NOT AVAILABLE



atlas_info:

  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/lib/sse2

  libraries lapack_atlas not found in /usr/lib/sse2

  libraries f77blas,cblas,atlas not found in /usr/lib

  libraries lapack_atlas not found in /usr/lib

  libraries f77blas,cblas,atlas not found in /usr/lib/i386-linux-gnu

  libraries lapack_atlas not found in /usr/lib/i386-linux-gnu

numpy.distutils.system_info.atlas_info

  NOT AVAILABLE



/usr/lib/python2.7/dist-packages/numpy/distutils/system_info.py:1427: 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/lib', '/usr/lib', '/usr/lib/i386-linux-gnu']

  NOT AVAILABLE



/usr/lib/python2.7/dist-packages/numpy/distutils/system_info.py:1438: 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/lib/python2.7/dist-packages/numpy/distutils/system_info.py:1441: 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_root/scipy/setup.py", line 253, in <module>

    setup_package()

  File "/tmp/pip_build_root/scipy/setup.py", line 250, in setup_package

    setup(**metadata)

  File "/usr/lib/python2.7/dist-packages/numpy/distutils/core.py", line 135, in setup

    config = configuration()

  File "/tmp/pip_build_root/scipy/setup.py", line 175, in configuration

    config.add_subpackage('scipy')

  File "/usr/lib/python2.7/dist-packages/numpy/distutils/misc_util.py", line 966, in add_subpackage

    caller_level = 2)

  File "/usr/lib/python2.7/dist-packages/numpy/distutils/misc_util.py", line 935, in get_subpackage

    caller_level = caller_level + 1)

  File "/usr/lib/python2.7/dist-packages/numpy/distutils/misc_util.py", line 872, 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/lib/python2.7/dist-packages/numpy/distutils/misc_util.py", line 966, in add_subpackage

    caller_level = 2)

  File "/usr/lib/python2.7/dist-packages/numpy/distutils/misc_util.py", line 935, in get_subpackage

    caller_level = caller_level + 1)

  File "/usr/lib/python2.7/dist-packages/numpy/distutils/misc_util.py", line 872, 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

----------------------------------------
Cleaning up...
  Removing temporary dir /tmp/pip_build_root...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/scipy/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-6DMxsQ-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/scipy
Exception information:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 283, in run
    requirement_set.install(install_options, global_options, root=options.root_path)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1435, in install
    requirement.install(install_options, global_options, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 706, in install
    cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
  File "/usr/lib/python2.7/dist-packages/pip/util.py", line 697, in call_subprocess
    % (command_desc, proc.returncode, cwd))
InstallationError: Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/scipy/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-6DMxsQ-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/scipy

请帮忙吗?

1 个答案:

答案 0 :(得分:4)

失败的是:

raise NotFoundError('no lapack/blas resources found')
numpy.distutils.system_info.NotFoundError: no lapack/blas resources found

看起来像blaslapack是scipy所需的线性代数库。尝试安装它们:

$ sudo apt-get install libblas-dev
$ sudo apt-get install liblapacke-dev

如果您收到锁定错误remove the lock