如何修复python spaCy错误:“undefined symbol:PySlice_AdjustIndices”?

时间:2017-05-21 09:17:30

标签: python spacy

使用here中的官方示例我有一个错误:

Traceback (most recent call last):
  File "/home/vv/PythProj/esi-code/webapp/sp_token.py", line 2, in <module>
    from spacy.en import English
  File "/home/vv/anaconda3/lib/python3.6/site-packages/spacy/__init__.py", line 4, in <module>
    from . import util
  File "/home/vv/anaconda3/lib/python3.6/site-packages/spacy/util.py", line 5, in <module>
    import regex as re
  File "/home/vv/anaconda3/lib/python3.6/site-packages/regex.py", line 394, in <module>
    import _regex_core
  File "/home/vv/anaconda3/lib/python3.6/site-packages/_regex_core.py", line 21, in <module>
    import _regex
ImportError: /home/vv/anaconda3/lib/python3.6/site-packages/_regex.cpython-36m-x86_64-linux-gnu.so: undefined symbol: PySlice_AdjustIndices

我该如何解决?谢谢你的帮助 附加信息: for command:conda search "^python$"

Fetching package metadata .........
python        1.0.1                         0  conda-forge     
              1.0.1                         0  defaults        
                  ... // closely 50 tuples
              3.6.1                         0  defaults        
              3.6.1                         1  conda-forge     
              3.6.1                         2  conda-forge     
              3.6.1                         2  defaults 

命令:

python --version
Python 3.6.0 :: Anaconda custom (64-bit)

命令:

pip --version
pip 9.0.1 from /home/vv/anaconda3/lib/python3.6/site-packages (python 3.6)

1 个答案:

答案 0 :(得分:0)

我无法解释,但是当我在idle3下运行sudo时它会起作用:

我使用Python shell并通过命令从终端运行它:idle3。后来当我编译代码时,我得到了上述错误。

但是:当我从终端开始时:sudo idle3它完美无缺。所以,我认为这是来自ubuntu访问的问题。

谢谢大家!