我在导入allennlp时遇到这个错误,
from allennlp.common.util import sanitize
ModuleNotFoundError: No module named 'allennlp.common'
(venv-kbs) administrator@NLR:~/aman/Project$ python
Python 3.6.3 (default, Oct 6 2017, 00:00:00)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import allennlp
>>> from allennlp.common.util import sanitize
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'allennlp.common'我的allennlp版本是0.2.1,即使尝试更新到0.4.1也会出现同样的错误。
提亚
发布于 2018-06-01 13:22:40
一定要检查python版本,Allennlp会定期推送更新,并根据Python和Pytorch版本工作。
https://stackoverflow.com/questions/50043826
复制相似问题