获取导入错误:无法导入名称OrderedDict(Getting ImportError: cann

2019-09-28 19:40发布

我正在错误

导入错误:无法导入名称OrderedDict

而我的Ubuntu 14.04本地机器上安装服务器。
我曾尝试手动安装ordereddict也试图提升海带,但它仍然给予充分和error.The回溯添加如下─

rishav @耍斯梯:〜/开事件奥尔加服务器$ sudo的蟒蛇create_db.py
回溯(最近通话最后一个):文件“create_db.py”,5号线,在
从应用程序导入CURRENT_APP
文件“/家/ rishav /开放式的事件奥尔加-服务器/应用/ 初始化的.py” 23行,在
芹菜芹菜进口
文件“/usr/local/lib/python2.7/dist-packages/celery/ 初始化的.py”,线路133,在
芹菜进口5#noqa文件“/usr/local/lib/python2.7/dist-packages/celery/five.py”,153行,在
从kombu.utils.compat进口OrderedDict#noqa
导入错误:无法导入名称OrderedDict

Answer 1:

这解决了我的问题:

  1. 降级海带到2.5.16。

  2. 重新安装Django的芹菜

这里是日志:

(virtualEnv) D:\Project\staging\modone\settings>pip install django-celery
Collecting django-celery
  Downloading django_celery-3.2.1-py2-none-any.whl (63kB)
    100% |################################| 71kB 83kB/s
Collecting django>=1.8 (from django-celery)
  Using cached Django-1.10.5-py2.py3-none-any.whl
Collecting celery<4.0,>=3.1.15 (from django-celery)
  Downloading celery-3.1.25-py2.py3-none-any.whl (526kB)
    100% |################################| 532kB 122kB/s
Requirement already satisfied: pytz>dev in d:\project\installations\virtualenv\lib\site-packages (from celery<4.0,>=3.1.15->django-celery)
Collecting kombu<3.1,>=3.0.37 (from celery<4.0,>=3.1.15->django-celery)
  Using cached kombu-3.0.37-py2.py3-none-any.whl
Collecting billiard<3.4,>=3.3.0.23 (from celery<4.0,>=3.1.15->django-celery)
  Downloading billiard-3.3.0.23-cp27-none-win32.whl (102kB)
    100% |################################| 102kB 114kB/s
Requirement already satisfied: anyjson>=0.3.3 in d:\project\installations\virtualenv\lib\site-packages (from kombu<3.1,>=3.0.37->celery<4.0,>=3.1.15->
django-celery)
Collecting amqp<2.0,>=1.4.9 (from kombu<3.1,>=3.0.37->celery<4.0,>=3.1.15->django-celery)
  Using cached amqp-1.4.9-py2.py3-none-any.whl
Installing collected packages: django, amqp, kombu, billiard, celery, django-celery
  Found existing installation: Django 1.4.5
    Uninstalling Django-1.4.5:
      Successfully uninstalled Django-1.4.5
  Found existing installation: amqp 1.0.13
    Uninstalling amqp-1.0.13:
      Successfully uninstalled amqp-1.0.13
  Found existing installation: kombu 2.5.16
    Uninstalling kombu-2.5.16:
      Successfully uninstalled kombu-2.5.16
  Found existing installation: billiard 2.7.3.28
    Uninstalling billiard-2.7.3.28:
      Successfully uninstalled billiard-2.7.3.28
  Found existing installation: celery 3.0.18
    Uninstalling celery-3.0.18:
      Successfully uninstalled celery-3.0.18
Successfully installed amqp-1.4.9 billiard-3.3.0.23 celery-3.1.25 django-1.10.5 django-celery-3.2.1 kombu-3.0.37


Answer 2:

我对蟒蛇2.7.8与海带4.0.x的这个同样的问题,我在降级海带到3.0.x的(这是我所需要的版本)来解决它。

没有时间来调查问题的原因,但是这可能与...



文章来源: Getting ImportError: cannot import name OrderedDict