我对一直运行的脚本使用pyhyphen
包。最近,我更新了MacOS Big Sur。Spyder很落后,但我通过运行一个虚拟环境和pip install
我需要的东西来解决这个问题。没有问题
现在,当我尝试运行from hyphen import Hyphenator
(here is the package page)时,出现以下错误:
[autoreload of hyphen.dictools failed: Traceback (most recent call last):
File "/Users/myname/anaconda3/lib/python3.8/site-packages/IPython/extensions/autoreload.py", line 245, in check
superreload(m, reload, self.old_objects)
File "/Users/myname/anaconda3/lib/python3.8/site-packages/IPython/extensions/autoreload.py", line 394, in superreload
module = reload(module)
File "/Users/myname/anaconda3/lib/python3.8/imp.py", line 314, in reload
return importlib.reload(module)
File "/Users/myname/anaconda3/lib/python3.8/importlib/__init__.py", line 159, in reload
raise ImportError(msg.format(parent_name),
ImportError: parent 'hyphen' not in sys.modules
]
runcell(0, '/Users/myname/Documents/project/project.py')
Traceback (most recent call last):
File "/Users/myname/Documents/project/project.py", line 17, in <module>
from hyphen import Hyphenator
File "/Users/myname/anaconda3/lib/python3.8/site-packages/hyphen/__init__.py", line 10, in <module>
from .hyphenator import Hyphenator
File "/Users/myname/anaconda3/lib/python3.8/site-packages/hyphen/hyphenator.py", line 27, in <module>
from . import hnj
RuntimeError: invalid slot offset
from hyphen import Hyphenator
是脚本中唯一的一行。我已经尝试卸载/重新安装该软件包600次了,但我找不到任何解决方案。所有其他软件包导入良好,没有问题
Spyder(在Anaconda中)正在运行python版本3.8.5。我安装了non-anaconda 3.9,但我无法想象这会有任何效果,因为我在虚拟环境中运行spyder
我建议您通过
anaconda
而不是pip
安装:安装软件包时似乎出现了问题
程序包hnj未正确编译
尝试手动安装并生成包
相关问题 更多 >
编程相关推荐