[英]Trouble running python unit tests with tox - ImportError for module that is already installed
我是 python 的新手,我正在尝试为这个项目运行单元测试: https://github.com/matrix-org/synapse
我正在从项目的顶层运行 tox。 我收到此错误:exceptions.ImportError: No module named pymacaroons
但是已经使用 pip 安装了 pymacaroons。 据我所知,我只有一个版本的 python。 真的被这里难住了。
tox
创建自己的虚拟环境并根据tox.ini
安装依赖tox.ini
。 pymacaroons
未在tox.ini
列出,因此未安装。 要安装它,可以将pymacaroons
添加到tox.ini
( [testenv]
节,密钥deps
),或者将-rrequirements.txt
添加到tox.ini
, pymacaroons
在requirements.txt
列出pymacaroons
。
如果您的-rrequirements.txt
中有tox.ini
并在requirements.txt
中列出pymacaroons
并且您仍然遇到问题,则可能是 tox 没有更新,删除文件夹.tox
将强制 tox 更新
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.