web-dev-qa-db-ja.com

UbuntuでのSciPy / Pythonのインストール

現在、チュートリアルに従っていますSciPyスタックのインストールをインストールする SciPy Ubuntu 12.04(正確なセンザンコウ)(私は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.

さらに、このモジュールが正しくインストールされているかどうかをテストするにはどうすればよいですか?

30
msusplugas

PyPM はそれをインストールする良い方法です。バージョンはベータ0.10.1で、すべての依存関係が含まれています。 PyPMにアクセスするには Active Python が必要ですが、簡単にインストールできるはずです。

pypm install scipi
1
Null_Fragment

私の通常の作業の流れは、 virtualenv を使用してPython最新のパッケージを使用した配布を行うことです。

この環境では、必要なすべてのパッケージを pip で、Sudo呼び出しなしでインストールおよび更新できます。

SciPy (および NumPy )のみが必要な場合:

$ Sudo apt-get install python-virtualenv python-pip
$ Sudo apt-get build-dep python-numpy python-scipy
$ # Create virtualenv in home
$ virtualenv .myenv
$ # Activate the virtualenv
$ source .myenv/bin/activate
(myenv)$ pip install -U numpy
(myenv)$ pip install -U scipy

(ルートアクセス権がない場合は、 here の説明に従ってvirtualenvおよびpipをインストールできます。ただし、NumPyとSciPyの依存関係が必要です。)

source .myenv/bin/activate.bash_profileを含めることができ、シェルは常にその環境で開始されます。 要件ファイル を使用すると、すべてのマシンに同じ環境を簡単にインストールして維持できます。

26
bmu

同じ問題がありました。次は私のために働いた:

Sudo apt-get install libblas-dev
Sudo apt-get install liblapack-dev
Sudo apt-get install gfortran
17
sir_gelato

出力が示すように、 Atlas をダウンロードしてインストールする必要があります。その後、SciPyのインストールを再試行してください。

他のオプションはapt-get install古いバージョン。これにより、すべての依存関係が自動インストールされます。そして、新しい方を手でインストールします。これにより、マシン上に/usr/share/pyshared最も可能性が高く、別の場所が/usr/localですが、モジュールのロードパスを変更することで、どれがロードされるかを確認できます。

また、--prefix=/usr/local、古いバージョンの上に新しいバージョンをインストールしている間、上書きされるだけで、パスのマングリングは必要ありません。

4
favoretti

ソースからSciPyを構築しようとしています。

install SciPyだけにする場合は、次のコマンドを使用します。

Sudo apt-get install python-scipy
3
drobison

私はOPと同じ問題を抱えていました(私にとっては Red Hat Linux 5.7;はい、それは古いことを知っています)、ATLASヘッダー(および「静的ライブラリ」)をインストールすることですべて修正されました経由:

 yum install atlas-devel
1
Rob Cranfill

Fedora 20の場合:

pip install virtualenv virtualenvwrapper
mkvirtualenv scipy_project
Sudo yum-buildep scipy
pip install scipy

私はそれが役立つことを願っています!

0
llazzaro