gpt4 book ai didi

python - 使用unittest和Python 3.6导入时出错

转载 作者:太空宇宙 更新时间:2023-11-03 15:09:45 24 4
gpt4 key购买 nike

我正在使用Python 3.6版本开发一个小项目。使用unittest实现单元测试我在执行python3 -m unittest时出错,但在执行python -m unittest时没有错误。

该错误显示导入错误,例如:

ModuleNotFoundError: No module named 'genome'

在Python 3.6中使用unittest有导入问题吗?

最佳答案

您可能调用两个不同版本的 Python,它们没有安装相同的软件包。

genome 似乎没有随 python3 安装。如果 genome 是 Internet 安装的软件包,您可以使用

修复此问题
python3 -m pip install genome

关于python - 使用unittest和Python 3.6导入时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44321870/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com