【发布时间】:2023-03-16 11:59:01
【问题描述】:
我在 IntelliJ-IDEA 中设置了一个 jep 项目,并且在运行我的代码时不断收到此错误:
Exception in thread "main" jep.JepException: <class 'ModuleNotFoundError'>: No module named 'spacy'
at src/main/python\nlq_wrapper.<module>(nlq_wrapper.py:2)
at <string>.<module>(<string>:1)
at jep.Jep.exec(Native Method)
at jep.Jep.exec(Jep.java:478)
at com.siemens.nlqwrapper.NLQWrapper.load(NLQWrapper.java:37)
at com.siemens.nlqwrapper.Main.main(Main.java:9)
即使 spacy 包含在我的解释器 SDK 包中。
另一个奇怪的事情是 IntelliJ-IDEA 中的 Python 终端可以找到并使用 spacy。
但是当我尝试从终端或系统的 CLI 运行程序时,它找不到模块并且我得到同样的错误。
我需要为 jep 做一些额外的配置才能使用其他 python 模块吗?还是 jep 与其他模块不兼容?
【问题讨论】:
-
能否添加您使用的运行配置的屏幕截图(运行|编辑配置...)?
-
@SergeyK。感谢您的澄清;我已经更新了我的问题以包括我的运行配置。我还应该添加我的项目结构吗?
-
尝试从系统 CLI 运行它并激活相同的 venv。结果如何?
-
@SergeyK。我已经这样做了,结果是一样的。
标签: java python intellij-idea jep