繁体   English   中英

运行其他外部 python 脚本时缺少 numpy

[英]Missing numpy while running other external python script

我正在尝试从 python 脚本运行 python 脚本。

我试着像这样运行它:

os.system("python /opt/mycroft/skills/useridentification-skill/speakerIdentificationProgram/scoring.py")

然后我尝试像这样导入文件:

import sys
sys.path.append("/opt/mycroft/skills/useridentification-skill/speakerIdentificationProgram")
from scoring import get_id_result

他们都返回了这个错误:

File "/opt/mycroft/skills/useridentification-skill/__init__.py", line 9, in <module>
    from scoring import get_id_result
  File "/opt/mycroft/skills/useridentification-skill/speakerIdentificationProgram/scoring.py", line 2, in <module>
    import numpy
ImportError: No module named 'numpy'

只需在终端中尝试pip install numpy 这将消除错误

我认为您在 score.py 中使用了 numpy 模块,但您尚未在虚拟环境中安装 numpy。 激活 virtualenv 后使用“pip install numpy”。

我假设你按照这个来添加技能,如果是这样的话,如果技能实际上需要它,它应该安装 numpy

https://mycroft-ai.gitbook.io/docs/mycroft-technologies/mycroft-core/msm

参考 - https://github.com/MycroftAI/documentation/issues/143

否则,你应该使用

mycroft-pip install numpy

并且你应该是激活mycroft venv的source ,然后使用Python命令来运行你的脚本

使用 Panda 库进行数据操作和文件访问。

https://www.learnpython.org/en/Pandas_Basics

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM