简体   繁体   English

在macOS Sierra上使用Homebrew安装卡在错误加载scipy上

[英]Stuck on error loading scipy, using Homebrew install, on macOS Sierra

This happens when I try to do: 当我尝试执行以下操作时会发生这种情况:

import scipy.io

Another scipy module, such as scipy.sparse, seems to be OK. 另一个scipy模块,例如scipy.sparse,似乎还可以。

The root error is: 根本错误是:

packages/scipy/special/__init__.py", line 636, in <module>
        from ._ufuncs import *
    ImportError: dlopen(/usr/local/lib/python2.7/site-packages/scipy/special/_ufuncs.so, 2): Symbol not found: ___addtf3

The full stack trace: 完整的堆栈跟踪:

Traceback (most recent call last):
  File "HistogramClassifier.py", line 3, in <module>
    import scipy.io
  File "/usr/local/lib/python2.7/site-packages/scipy/io/__init__.py", line 97, in <module>
    from .matlab import loadmat, savemat, whosmat, byteordercodes
  File "/usr/local/lib/python2.7/site-packages/scipy/io/matlab/__init__.py", line 13, in <module>
    from .mio import loadmat, savemat, whosmat
  File "/usr/local/lib/python2.7/site-packages/scipy/io/matlab/mio.py", line 12, in <module>
    from .miobase import get_matfile_version, docfiller
  File "/usr/local/lib/python2.7/site-packages/scipy/io/matlab/miobase.py", line 22, in <module>
    from scipy.misc import doccer
  File "/usr/local/lib/python2.7/site-packages/scipy/misc/__init__.py", line 51, in <module>
    from scipy.special import comb, factorial, factorial2, factorialk
  File "/usr/local/lib/python2.7/site-packages/scipy/special/__init__.py", line 636, in <module>
    from ._ufuncs import *
ImportError: dlopen(/usr/local/lib/python2.7/site-packages/scipy/special/_ufuncs.so, 2): Symbol not found: ___addtf3
  Referenced from: /usr/local/lib/python2.7/site-packages/scipy/special/../.dylibs/libquadmath.0.dylib
  Expected in: /usr/lib/libSystem.B.dylib
 in /usr/local/lib/python2.7/site-packages/scipy/special/../.dylibs/libquadmath.0.dylib

That's pretty much it. 就是这样。 Google returns quite a few hits, but they're either very old, or not the same lib, or things that I've tried. Google返回了很多匹配,但它们要么很旧,要么不是同一个lib,要么是我尝试过的东西。 The rest of this post is all the stuff I found/tried so far that didn't work. 这篇文章的其余部分是到目前为止我发现/尝试过的所有无法使用的东西。

Double checking python: 仔细检查python:

which python
/usr/local/bin/python

ls -l /usr/local/bin/python
lrwxr-xr-x  ... /usr/local/bin/python -> ../Cellar/python/2.7.13/bin/python

I'm not currently using virtual env. 我当前未使用虚拟环境。

I think Homebrew is OK: 我认为自制软件还可以:

brew doctor
Your system is ready to brew.

This is after trying this: 这是尝试后:

brew update
brew upgrade

I've also tried uninstalling and reinstalling the scipy package, both with brew and with pip. 我还尝试了通过brew和pip卸载并重新安装scipy软件包。

I've tried various other things, but don't want to mess up a working Homebrew setup. 我尝试了其他各种方法,但不想弄乱可正常工作的Homebrew设置。

Older posts that Google brought back talk about "cobra", as far as I know I'm not using that. 据我所知,谷歌带回了有关“眼镜蛇”的较早帖子。 "which cobra" doesn't return anything. “哪个眼镜蛇”什么也不会返回。

Other things from Google talk about the order of the library path, but that seemed to be if you were using the built-in python, which I don't don't think is applicable since I believe I'm using Homebrew's version. Google的其他事情都在谈论库路径的顺序,但这似乎是在使用内置的python,我认为这并不适用,因为我相信我正在使用Homebrew的版本。

Clearly it has something to do with a library, maybe fortran related, but what to type in to fix it... don't know where to start. 显然,它与可能与fortran相关的库有关,但是要键入什么来修复它……不知道从哪里开始。

尝试以下操作:临时删除/usr/lib/libSystem.B.dylib,然后重新安装scipy。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM