How to fix a python spaCy error: "undefined symbol: PySlice_AdjustIndices"?

How to fix a python spaCy error: "undefined symbol: PySlice_AdjustIndices"?

使用来自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

我该如何解决?谢谢你的帮助 附加信息: 对于命令: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)

我无法解释,但是当我 运行 idle3sudo:

下时它起作用了

我通过命令从终端使用 Python shell 和 运行:idle3。稍后当我编译代码时出现上述错误。

但是:当我从终端启动时:sudo idle3 它运行完美,没有任何错误。所以,我认为这是 ubuntu.

中访问的问题

谢谢大家!