问题描述
我是python的新手,正在尝试为此项目运行单元测试: https://github.com/matrix-org/synapse
我正在从项目的顶层运行tox.我收到此错误:exceptions.ImportError:没有名为pymacaroons的模块
但是pymacaroons已经使用pip安装.据我所知,我只有一个版本的python.真的很困在这里.
tox
创建自己的虚拟环境,并根据tox.ini
安装依赖项. pymacaroons
未在tox.ini
中列出,因此未安装.要安装它,可以在tox.ini
中添加pymacaroons
(在[testenv]
部分,键deps
),或者在tox.ini
中添加-rrequirements.txt
并在requirements.txt
中列出pymacaroons
.
I am new to python and am trying to run unit tests for this project:https://github.com/matrix-org/synapse
I am running tox from the top level of the project. I get this error:exceptions.ImportError: No module named pymacaroons
But pymacaroons is already installed using pip. To my knowledge, I only have one version of python. Really stumped here.
tox
creates its own virtual environments and installs dependencies according to tox.ini
. pymacaroons
is not listed in tox.ini
hence it's not installed. To install it either add pymacaroons
to tox.ini
(section [testenv]
, key deps
) or add -rrequirements.txt
to tox.ini
and list pymacaroons
in the requirements.txt
.
这篇关于使用tox运行python单元测试时遇到问题-已安装模块的ImportError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!