![](/img/trans.png)
[英]airflow initdb in Docker throws ImportError: cannot import name 'import_string'
[英]Django: "cannot import name import_string" while using "rest_framework_docs"
我按照這里提到的步驟安裝了drfdocs
。 但我cannot import name import_string
。
以下是堆棧跟蹤:
ImportError at /
cannot import name import_string
Request Method: GET
Request URL: http://127.0.0.1:8000/
Django Version: 1.6.5
Exception Type: ImportError
Exception Value:
cannot import name import_string
Exception Location: /usr/local/lib/python2.7/dist-packages/rest_framework_docs/api_docs.py in <module>, line 4
Python Executable: /usr/bin/python
我正在使用Django 1.6.5
和django-rest-framework-docs==0.1.7
以下是我系統上安裝的pip packages
列表:
moin@moin-pc:~/workspace/my_project$ pip freeze
adium-theme-ubuntu==0.3.4
boto==2.42.0
coreapi==2.0.0
dateutils==0.6.6
Django==1.6.5
django-cors-headers==1.1.0
django-countries==4.0
django-debug-toolbar==1.5
django-rest-framework-docs==0.1.7
django-rest-swagger==2.0.5
django-storages==1.5.1
django-tastypie==0.13.3
django-tastypie-swagger==0.1.4
djangorestframework==2.3.13
drfdocs==0.0.11
itypes==1.1.0
jsonpickle==0.9.3
mysqlclient==1.3.7
openapi-codec==1.0.0
Pillow==3.3.1
psycopg2==2.6.2
pygeocoder==1.2.5
python-dateutil==2.5.3
python-mimeparse==1.5.2
pytz==2016.6.1
PyYAML==3.12
requests==2.11.1
simplejson==3.8.2
six==1.10.0
sqlparse==0.2.1
ua-parser==0.7.1
unity-lens-photos==1.0
uritemplate==3.0.0
user-agents==1.0.1
我確定這是由於包版本之間的任何沖突。 任何幫助將不勝感激。
這是由於drfdocs
版本與django-rest-framework
的沖突。 將我的版本從drfdocs==0.0.11
降級到drfdocs==0.0.6
解決了這個問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.