scipy安装在山狮失败

当我尝试使用pip install scipy安装scipy时,它会失败并显示以下回溯

Downloading/unpacking scipy
  Downloading scipy-0.10.1.tar.gz (6.2MB): 6.2MB downloaded
  Running setup.py egg_info for package scipy
    Running from scipy source directory.
    blas_opt_info:
      FOUND:
        extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
        define_macros = [('NO_ATLAS_INFO', 3)]
        extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']

    non-existing path in '/private/var/folders/rd/fplkflh93ls54kbl5ylphl4h0000gn/T/pip-build/scipy/scipy/io': 'docs'
    lapack_opt_info:
      FOUND:
        extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
        define_macros = [('NO_ATLAS_INFO', 3)]
        extra_compile_args = ['-msse3']

    umfpack_info:
      libraries umfpack not found in /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib
      libraries umfpack not found in /usr/local/lib
      libraries umfpack not found in /usr/lib
    /usr/local/lib/python2.7/site-packages/numpy/distutils/system_info.py:470: UserWarning:
        UMFPACK sparse solver (http://www.cise.ufl.edu/research/sparse/umfpack/)
        not found. Directories to search for the libraries can be specified in the
        numpy/distutils/site.cfg file (section [umfpack]) or by setting
        the UMFPACK environment variable.
      warnings.warn(self.notfounderror.__doc__)
      NOT AVAILABLE

    Traceback (most recent call last):
      File "<string>", line 16, in <module>
      File "/var/folders/rd/fplkflh93ls54kbl5ylphl4h0000gn/T/pip-build/scipy/setup.py", line 196, in <module>
        setup_package()
      File "/var/folders/rd/fplkflh93ls54kbl5ylphl4h0000gn/T/pip-build/scipy/setup.py", line 187, in setup_package
        configuration=configuration )
      File "/usr/local/lib/python2.7/site-packages/numpy/distutils/core.py", line 152, in setup
        config = configuration()
      File "/var/folders/rd/fplkflh93ls54kbl5ylphl4h0000gn/T/pip-build/scipy/setup.py", line 138, in configuration
        config.add_subpackage('scipy')
      File "/usr/local/lib/python2.7/site-packages/numpy/distutils/misc_util.py", line 1002, in add_subpackage
        caller_level = 2)
      File "/usr/local/lib/python2.7/site-packages/numpy/distutils/misc_util.py", line 971, in get_subpackage
        caller_level = caller_level + 1)
      File "/usr/local/lib/python2.7/site-packages/numpy/distutils/misc_util.py", line 908, in _get_configuration_from_setup_py
        config = setup_module.configuration(*args)
      File "scipy/setup.py", line 20, in configuration
        config.add_subpackage('special')
      File "/usr/local/lib/python2.7/site-packages/numpy/distutils/misc_util.py", line 1002, in add_subpackage
        caller_level = 2)
      File "/usr/local/lib/python2.7/site-packages/numpy/distutils/misc_util.py", line 971, in get_subpackage
        caller_level = caller_level + 1)
      File "/usr/local/lib/python2.7/site-packages/numpy/distutils/misc_util.py", line 908, in _get_configuration_from_setup_py
        config = setup_module.configuration(*args)
      File "/private/var/folders/rd/fplkflh93ls54kbl5ylphl4h0000gn/T/pip-build/scipy/scipy/special/setup.py", line 54, in configuration
        extra_info=get_info("npymath")
      File "/usr/local/lib/python2.7/site-packages/numpy/distutils/misc_util.py", line 2220, in get_info
        pkg_info = get_pkg_info(pkgname, dirs)
      File "/usr/local/lib/python2.7/site-packages/numpy/distutils/misc_util.py", line 2172, in get_pkg_info
        return read_config(pkgname, dirs)
      File "/usr/local/lib/python2.7/site-packages/numpy/distutils/npy_pkg_config.py", line 390, in read_config
        v = _read_config_imp(pkg_to_filename(pkgname), dirs)
      File "/usr/local/lib/python2.7/site-packages/numpy/distutils/npy_pkg_config.py", line 326, in _read_config_imp
        meta, vars, sections, reqs = _read_config(filenames)
      File "/usr/local/lib/python2.7/site-packages/numpy/distutils/npy_pkg_config.py", line 309, in _read_config
        meta, vars, sections, reqs = parse_config(f, dirs)
      File "/usr/local/lib/python2.7/site-packages/numpy/distutils/npy_pkg_config.py", line 281, in parse_config
        raise PkgNotFound("Could not find file(s) %s" % str(filenames))
    numpy.distutils.npy_pkg_config.PkgNotFound: Could not find file(s) ['/usr/local/lib/python2.7/site-packages/numpy/core/lib/npy-pkg-config/npymath.ini']

我正在使用Mountain Lion,以及使用自制软件安装的python 2.7.3,并且使用pip install numpy安装numpy。

为什么scipy安装失败?


这似乎是pip和numpy的问题,它不会将编译的库复制到site-packages目录中。

你可以使用pip来安装virtualenv(对我有用)或者使用安装源代码来安装

python setup.py install

方法。

这里有一些关于问题的评论:

http://www.thisisthegreenroom.com/2011/installing-python-numpy-scipy-matplotlib-and-ipython-on-lion/


如果您使用自制软件,您可以尝试以下内容(感谢https://github.com/pypa/pip/issues/707):

brew tap samueljohn/homebrew-python
brew install numpy
brew install scipy

如果您不使用virtualenv ,那么可以手动编辑最少侵入修补程序/usr/local/lib/python2.7/site-packages/pip-1.2.1-py2.7.egg/pip/locations.py (您的点子版本可能会有所不同)。 只需从以下行替换第35行:

build_prefix = os.path.join(tempfile.gettempdir(), 'pip-build') 

至:

build_prefix = os.path.realpath(os.path.join(tempfile.gettempdir(), 'pip-build')) 

在此更改之后,您需要重新安装numpypip uninstall numpy; pip install numpy )。 scipy然后可以通过点正确安装。

该问题是由点差错引起的。 上面的解决方案是根据github用户qwcode的pip补丁(在Lokkju提到的问题讨论中提出的)。 这个补丁似乎已经合并到主要的点存储库。 然而,我并没有看到一种简单的方法来酝酿更新点子,因为它与Python捆绑在一起。 所以只需手动使这个简单的修复工作适合我。

链接地址: http://www.djcxy.com/p/87169.html

上一篇: scipy install on mountain lion failing

下一篇: SciPy and NumPy on Mac OS 10.6.8