为什么我在安装依赖项之前遇到tox导入错误

时间:2018-03-05 18:13:51

标签: python django tox

在我的django项目中,我有一个导入芹菜的paypal.Button.render({ payment: function() {}, onAuthorize: function(data) {}, onError: function(err) { // error handling }, onCancel: function(data, actions) { // cancel handling }, }); 文件,我怀疑这可能导致tox抱怨。

__init__.py

/testproj/testproj/ ____init___.py

当我运行tox时,测试成功运行,但我看到了这个错误。

from .celery import app as celery_app

我觉得奇怪的是导入错误高于芹菜导入的实际导入。

为什么我收到此错误?如上所示,Celery在我的File "/dir/work/testproj/testproj/celery.py", line 2, in <module> from celery import Celery ImportError: cannot import name Celery mobilereports installed: amqp==1.4.9,anyjson==0.3.3,appdirs==1.4.0,Babel==2.3.4,billiard==3.3.0.23,cached-property==1.3.0,celery==3.1.24 中由tox安装,那么为什么在deps实际安装之前我会遇到导入错误?

requirements.txt

1 个答案:

答案 0 :(得分:0)

尝试将您的celery.py文件重命名为其他内容。它可能掩盖了通过需求安装的celery模块(因此from celery import Celery行可能是从模块本身导入的。)