当前位置: 首页 > 面试题库 >

在Ubuntu上安装SciPy / Python

龚迪
2023-03-14
问题内容

我目前正在关注 安装SciPy堆栈 的教程
以便在Ubuntu
12.04(精确的穿山甲)上安装SciPy(我无法使用,apt-get install因为我需要最新版本)。

但是,执行以下命令时出现错误:

python setup.py build
sudo python setup.py install --prefix=/usr/local   # Installs to /usr/local

python setup.py build

michael@michael-laptop-ubuntu:~/Downloads/scipy-0.11.0rc1$ python setup.py buildRunning from scipy source directory.
blas_opt_info:
blas_mkl_info:
  libraries mkl,vml,guide not found in /usr/local/lib
  libraries mkl,vml,guide not found in /usr/lib
  libraries mkl,vml,guide not found in /usr/lib/i386-linux-gnu
  NOT AVAILABLE

atlas_blas_threads_info:
Setting PTATLAS=ATLAS
  libraries ptf77blas,ptcblas,atlas not found in /usr/local/lib
  libraries ptf77blas,ptcblas,atlas not found in /usr/lib/sse2
  libraries ptf77blas,ptcblas,atlas not found in /usr/lib
  libraries ptf77blas,ptcblas,atlas not found in /usr/lib/i386-linux-gnu/sse2
  libraries ptf77blas,ptcblas,atlas not found in /usr/lib/i386-linux-gnu
  NOT AVAILABLE

atlas_blas_info:
  libraries f77blas,cblas,atlas not found in /usr/local/lib
  libraries f77blas,cblas,atlas not found in /usr/lib/sse2
  libraries f77blas,cblas,atlas not found in /usr/lib
  libraries f77blas,cblas,atlas not found in /usr/lib/i386-linux-gnu/sse2
  libraries f77blas,cblas,atlas not found in /usr/lib/i386-linux-gnu
  NOT AVAILABLE

/usr/lib/python2.7/dist-packages/numpy/distutils/system_info.py:1423: 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__)
blas_info:
  libraries blas not found in /usr/local/lib
  libraries blas not found in /usr/lib
  libraries blas not found in /usr/lib/i386-linux-gnu
  NOT AVAILABLE

/usr/lib/python2.7/dist-packages/numpy/distutils/system_info.py:1432: 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.
  warnings.warn(BlasNotFoundError.__doc__)
blas_src_info:
  NOT AVAILABLE

/usr/lib/python2.7/dist-packages/numpy/distutils/system_info.py:1435: 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.
  warnings.warn(BlasSrcNotFoundError.__doc__)
Traceback (most recent call last):
  File "setup.py", line 208, in <module>
    setup_package()
  File "setup.py", line 199, in setup_package
    configuration=configuration )
  File "/usr/lib/python2.7/dist-packages/numpy/distutils/core.py", line 152, in setup
    config = configuration()
  File "setup.py", line 136, in configuration
    config.add_subpackage('scipy')
  File "/usr/lib/python2.7/dist-packages/numpy/distutils/misc_util.py", line 1002, in add_subpackage
    caller_level = 2)
  File "/usr/lib/python2.7/dist-packages/numpy/distutils/misc_util.py", line 971, in get_subpackage
    caller_level = caller_level + 1)
  File "/usr/lib/python2.7/dist-packages/numpy/distutils/misc_util.py", line 908, in _get_configuration_from_setup_py
    config = setup_module.configuration(*args)
  File "scipy/setup.py", line 8, in configuration
    config.add_subpackage('integrate')
  File "/usr/lib/python2.7/dist-packages/numpy/distutils/misc_util.py", line 1002, in add_subpackage
    caller_level = 2)
  File "/usr/lib/python2.7/dist-packages/numpy/distutils/misc_util.py", line 971, in get_subpackage
    caller_level = caller_level + 1)
  File "/usr/lib/python2.7/dist-packages/numpy/distutils/misc_util.py", line 908, in _get_configuration_from_setup_py
    config = setup_module.configuration(*args)
  File "scipy/integrate/setup.py", line 10, in configuration
    blas_opt = get_info('blas_opt',notfound_action=2)
  File "/usr/lib/python2.7/dist-packages/numpy/distutils/system_info.py", line 320, in get_info
    return cl().get_info(notfound_action)
  File "/usr/lib/python2.7/dist-packages/numpy/distutils/system_info.py", line 471, in get_info
    raise self.notfounderror(self.notfounderror.__doc__)
numpy.distutils.system_info.BlasNotFoundError: 
    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.
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/apport_python_hook.py", line 64, in apport_excepthook
    from apport.fileutils import likely_packaged, get_recent_crashes
  File "/usr/lib/python2.7/dist-packages/apport/__init__.py", line 1, in <module>
    from apport.report import Report
  File "/usr/lib/python2.7/dist-packages/apport/report.py", line 18, in <module>
    import problem_report
  File "/usr/lib/python2.7/dist-packages/problem_report.py", line 14, in <module>
    import zlib, base64, time, sys, gzip, struct, os
  File "/usr/lib/python2.7/gzip.py", line 10, in <module>
    import io
  File "/home/michael/Downloads/scipy-0.11.0rc1/scipy/io/__init__.py", line 83, in <module>
    from matlab import loadmat, savemat, byteordercodes
  File "/home/michael/Downloads/scipy-0.11.0rc1/scipy/io/matlab/__init__.py", line 11, in <module>
    from mio import loadmat, savemat
  File "/home/michael/Downloads/scipy-0.11.0rc1/scipy/io/matlab/mio.py", line 15, in <module>
    from mio4 import MatFile4Reader, MatFile4Writer
  File "/home/michael/Downloads/scipy-0.11.0rc1/scipy/io/matlab/mio4.py", line 9, in <module>
    import scipy.sparse
  File "/home/michael/Downloads/scipy-0.11.0rc1/scipy/sparse/__init__.py", line 180, in <module>
    from csr import *
  File "/home/michael/Downloads/scipy-0.11.0rc1/scipy/sparse/csr.py", line 12, in <module>
    from sparsetools import csr_tocsc, csr_tobsr, csr_count_blocks, \
  File "/home/michael/Downloads/scipy-0.11.0rc1/scipy/sparse/sparsetools/__init__.py", line 4, in <module>
    from csr import *
  File "/home/michael/Downloads/scipy-0.11.0rc1/scipy/sparse/sparsetools/csr.py", line 25, in <module>
    _csr = swig_import_helper()
  File "/home/michael/Downloads/scipy-0.11.0rc1/scipy/sparse/sparsetools/csr.py", line 17, in swig_import_helper
    import _csr
ImportError: No module named _csr

Original exception was:
Traceback (most recent call last):
  File "setup.py", line 208, in <module>
    setup_package()
  File "setup.py", line 199, in setup_package
    configuration=configuration )
  File "/usr/lib/python2.7/dist-packages/numpy/distutils/core.py", line 152, in setup
    config = configuration()
  File "setup.py", line 136, in configuration
    config.add_subpackage('scipy')
  File "/usr/lib/python2.7/dist-packages/numpy/distutils/misc_util.py", line 1002, in add_subpackage
    caller_level = 2)
  File "/usr/lib/python2.7/dist-packages/numpy/distutils/misc_util.py", line 971, in get_subpackage
    caller_level = caller_level + 1)
  File "/usr/lib/python2.7/dist-packages/numpy/distutils/misc_util.py", line 908, in _get_configuration_from_setup_py
    config = setup_module.configuration(*args)
  File "scipy/setup.py", line 8, in configuration
    config.add_subpackage('integrate')
  File "/usr/lib/python2.7/dist-packages/numpy/distutils/misc_util.py", line 1002, in add_subpackage
    caller_level = 2)
  File "/usr/lib/python2.7/dist-packages/numpy/distutils/misc_util.py", line 971, in get_subpackage
    caller_level = caller_level + 1)
  File "/usr/lib/python2.7/dist-packages/numpy/distutils/misc_util.py", line 908, in _get_configuration_from_setup_py
    config = setup_module.configuration(*args)
  File "scipy/integrate/setup.py", line 10, in configuration
    blas_opt = get_info('blas_opt',notfound_action=2)
  File "/usr/lib/python2.7/dist-packages/numpy/distutils/system_info.py", line 320, in get_info
    return cl().get_info(notfound_action)
  File "/usr/lib/python2.7/dist-packages/numpy/distutils/system_info.py", line 471, in get_info
    raise self.notfounderror(self.notfounderror.__doc__)
numpy.distutils.system_info.BlasNotFoundError: 
    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.

sudo python setup.py install –prefix = / usr / local#安装到/ usr / local

michael@michael-laptop-ubuntu:~/Downloads/scipy-0.11.0rc1$ sudo python setup.py install --prefix=/usr/local
[sudo] password for michael: 
Running from scipy source directory.
blas_opt_info:
blas_mkl_info:
  libraries mkl,vml,guide not found in /usr/local/lib
  libraries mkl,vml,guide not found in /usr/lib
  libraries mkl,vml,guide not found in /usr/lib/i386-linux-gnu
  NOT AVAILABLE

atlas_blas_threads_info:
Setting PTATLAS=ATLAS
  libraries ptf77blas,ptcblas,atlas not found in /usr/local/lib
  libraries ptf77blas,ptcblas,atlas not found in /usr/lib/sse2
  libraries ptf77blas,ptcblas,atlas not found in /usr/lib
  libraries ptf77blas,ptcblas,atlas not found in /usr/lib/i386-linux-gnu/sse2
  libraries ptf77blas,ptcblas,atlas not found in /usr/lib/i386-linux-gnu
  NOT AVAILABLE

atlas_blas_info:
  libraries f77blas,cblas,atlas not found in /usr/local/lib
  libraries f77blas,cblas,atlas not found in /usr/lib/sse2
  libraries f77blas,cblas,atlas not found in /usr/lib
  libraries f77blas,cblas,atlas not found in /usr/lib/i386-linux-gnu/sse2
  libraries f77blas,cblas,atlas not found in /usr/lib/i386-linux-gnu
  NOT AVAILABLE

/usr/lib/python2.7/dist-packages/numpy/distutils/system_info.py:1423: 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__)
blas_info:
  libraries blas not found in /usr/local/lib
  libraries blas not found in /usr/lib
  libraries blas not found in /usr/lib/i386-linux-gnu
  NOT AVAILABLE

/usr/lib/python2.7/dist-packages/numpy/distutils/system_info.py:1432: 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.
  warnings.warn(BlasNotFoundError.__doc__)
blas_src_info:
  NOT AVAILABLE

/usr/lib/python2.7/dist-packages/numpy/distutils/system_info.py:1435: 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.
  warnings.warn(BlasSrcNotFoundError.__doc__)
Traceback (most recent call last):
  File "setup.py", line 208, in <module>
    setup_package()
  File "setup.py", line 199, in setup_package
    configuration=configuration )
  File "/usr/lib/python2.7/dist-packages/numpy/distutils/core.py", line 152, in setup
    config = configuration()
  File "setup.py", line 136, in configuration
    config.add_subpackage('scipy')
  File "/usr/lib/python2.7/dist-packages/numpy/distutils/misc_util.py", line 1002, in add_subpackage
    caller_level = 2)
  File "/usr/lib/python2.7/dist-packages/numpy/distutils/misc_util.py", line 971, in get_subpackage
    caller_level = caller_level + 1)
  File "/usr/lib/python2.7/dist-packages/numpy/distutils/misc_util.py", line 908, in _get_configuration_from_setup_py
    config = setup_module.configuration(*args)
  File "scipy/setup.py", line 8, in configuration
    config.add_subpackage('integrate')
  File "/usr/lib/python2.7/dist-packages/numpy/distutils/misc_util.py", line 1002, in add_subpackage
    caller_level = 2)
  File "/usr/lib/python2.7/dist-packages/numpy/distutils/misc_util.py", line 971, in get_subpackage
    caller_level = caller_level + 1)
  File "/usr/lib/python2.7/dist-packages/numpy/distutils/misc_util.py", line 908, in _get_configuration_from_setup_py
    config = setup_module.configuration(*args)
  File "scipy/integrate/setup.py", line 10, in configuration
    blas_opt = get_info('blas_opt',notfound_action=2)
  File "/usr/lib/python2.7/dist-packages/numpy/distutils/system_info.py", line 320, in get_info
    return cl().get_info(notfound_action)
  File "/usr/lib/python2.7/dist-packages/numpy/distutils/system_info.py", line 471, in get_info
    raise self.notfounderror(self.notfounderror.__doc__)
numpy.distutils.system_info.BlasNotFoundError: 
    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.
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/apport_python_hook.py", line 64, in apport_excepthook
    from apport.fileutils import likely_packaged, get_recent_crashes
  File "/usr/lib/python2.7/dist-packages/apport/__init__.py", line 1, in <module>
    from apport.report import Report
  File "/usr/lib/python2.7/dist-packages/apport/report.py", line 18, in <module>
    import problem_report
  File "/usr/lib/python2.7/dist-packages/problem_report.py", line 14, in <module>
    import zlib, base64, time, sys, gzip, struct, os
  File "/usr/lib/python2.7/gzip.py", line 10, in <module>
    import io
  File "/home/michael/Downloads/scipy-0.11.0rc1/scipy/io/__init__.py", line 83, in <module>
    from matlab import loadmat, savemat, byteordercodes
  File "/home/michael/Downloads/scipy-0.11.0rc1/scipy/io/matlab/__init__.py", line 11, in <module>
    from mio import loadmat, savemat
  File "/home/michael/Downloads/scipy-0.11.0rc1/scipy/io/matlab/mio.py", line 15, in <module>
    from mio4 import MatFile4Reader, MatFile4Writer
  File "/home/michael/Downloads/scipy-0.11.0rc1/scipy/io/matlab/mio4.py", line 9, in <module>
    import scipy.sparse
  File "/home/michael/Downloads/scipy-0.11.0rc1/scipy/sparse/__init__.py", line 180, in <module>
    from csr import *
  File "/home/michael/Downloads/scipy-0.11.0rc1/scipy/sparse/csr.py", line 12, in <module>
    from sparsetools import csr_tocsc, csr_tobsr, csr_count_blocks, \
  File "/home/michael/Downloads/scipy-0.11.0rc1/scipy/sparse/sparsetools/__init__.py", line 4, in <module>
    from csr import *
  File "/home/michael/Downloads/scipy-0.11.0rc1/scipy/sparse/sparsetools/csr.py", line 25, in <module>
    _csr = swig_import_helper()
  File "/home/michael/Downloads/scipy-0.11.0rc1/scipy/sparse/sparsetools/csr.py", line 17, in swig_import_helper
    import _csr
ImportError: No module named _csr

Original exception was:
Traceback (most recent call last):
  File "setup.py", line 208, in <module>
    setup_package()
  File "setup.py", line 199, in setup_package
    configuration=configuration )
  File "/usr/lib/python2.7/dist-packages/numpy/distutils/core.py", line 152, in setup
    config = configuration()
  File "setup.py", line 136, in configuration
    config.add_subpackage('scipy')
  File "/usr/lib/python2.7/dist-packages/numpy/distutils/misc_util.py", line 1002, in add_subpackage
    caller_level = 2)
  File "/usr/lib/python2.7/dist-packages/numpy/distutils/misc_util.py", line 971, in get_subpackage
    caller_level = caller_level + 1)
  File "/usr/lib/python2.7/dist-packages/numpy/distutils/misc_util.py", line 908, in _get_configuration_from_setup_py
    config = setup_module.configuration(*args)
  File "scipy/setup.py", line 8, in configuration
    config.add_subpackage('integrate')
  File "/usr/lib/python2.7/dist-packages/numpy/distutils/misc_util.py", line 1002, in add_subpackage
    caller_level = 2)
  File "/usr/lib/python2.7/dist-packages/numpy/distutils/misc_util.py", line 971, in get_subpackage
    caller_level = caller_level + 1)
  File "/usr/lib/python2.7/dist-packages/numpy/distutils/misc_util.py", line 908, in _get_configuration_from_setup_py
    config = setup_module.configuration(*args)
  File "scipy/integrate/setup.py", line 10, in configuration
    blas_opt = get_info('blas_opt',notfound_action=2)
  File "/usr/lib/python2.7/dist-packages/numpy/distutils/system_info.py", line 320, in get_info
    return cl().get_info(notfound_action)
  File "/usr/lib/python2.7/dist-packages/numpy/distutils/system_info.py", line 471, in get_info
    raise self.notfounderror(self.notfounderror.__doc__)
numpy.distutils.system_info.BlasNotFoundError: 
    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.

此外,如何测试此模块是否正确安装?


问题答案:

PyPM是安装它的好方法。版本是beta
0.10.1,它包含所有依赖项。您需要使用Active
Python来访问PyPM,但是您应该能够轻松安装。

pypm install scipi


 类似资料:
  • 问题内容: 我安装了Python 2.7和NumPy。我已经下载了SciPy的预构建二进制文件,但是安装脚本因以下错误而失败: 找不到Blas库。可以在文件(部分)中指定搜索目录的目录,也可以通过设置BLAS环境变量来指定 目录。 我真的对这件事还不了解。我以为这是一个简单的安装过程,但事实并非如此。我用Google搜索了BLAS环境变量,但是找不到任何合适的变量。任何帮助表示赞赏。 麦克风 编辑

  • 问题内容: 我正在尝试在Ubuntu10.04上安装RMagick。但没有喜悦。我什至从源代码编译并安装了ImageMagick,但是当我尝试使用RubyGems安装RMagick时,这里的说明仍然没有帮助。我收到此错误: 这是什么意思呢?:)我是Ruby和RubyGems的新手,所以请保持谦虚。我的设置如下: 我几乎没有想法(也很累!)。我厌倦了使用上面的链接从源代码编译RMagick,但是由于

  • 问题内容: 我正在尝试在Ubuntu 12.10上安装Node.js,但是终端显示了有关丢失软件包的错误。我尝试了这个: 但是当我来到最后一行时显示此错误: 然后,我卸载了,并尝试了第二种选择: 终端机说相同的错误,但同时也向我显示了我在顶部显示的文本。我认为是问题所在,但我不知道如何解决。 问题答案: 只需按照此处给出的说明进行操作: 安装示例: 它会在当前稳定的Ubuntu上安装当前稳定的No

  • 然后卸载,尝试第二个选项: 同样的错误,终端说,但它也显示了我在顶部显示的文本。我认为问题是,但我不知道如何解决它。

  • 问题内容: 我似乎无法正确安装zlib,我在Ubuntu10.4上从源代码安装了Python ’########编辑 bobince和Luper帮助了#################### bobince。 确保安装了这些软件包,然后重新编译Python: sudo aptitude install zlib1g-dev libreadline6-dev libdb4.8-dev libncur

  • 问题内容: 安装Java我一直从终端使用经典方法。我想手动安装Java。我将JDK的文件夹放在桌子上,并设置了环境变量(PATH,CLASSPATH和JAVA_HOME)。从终端,如果我键入,我会被打印 但是,当我尝试安装eclipse或netbeans时,系统警告说机器上没有安装Java。 手动安装缺少哪些内容?(Ubuntu 13.04) 问题答案: 该答案用于描述如何安装Oracle Jav