LoginSignup
0
0

More than 1 year has passed since last update.

Django REST APIの構築中に"ImportError: cannot import name 'six' from 'django.utils'"と"ImportError: cannot import name 'six' from 'django.utils'"が発生

Posted at

Django REST APIの勉強をしていたら、以下エラーが出てmanage.py runsererが動いてくれない。

ImportError: cannot import name 'six' from 'django.utils'

この問題はpipでdjango-utils-sixをインストールして解決。

$ pip install django-utils-six

すると今度は新たに以下エラーが出てしまった。

ImportError: cannot import name 'STATUS_CODE_TEXT' from 'django.core.handlers.wsgi'

調べてみると、djangorestframeworkが古いと出ることがあるらしい。結局以下コマンドで解決出来た。

$ pip install -U djangorestframework

(自分の環境ではdjangorestframework-3.1.1が入っていたのだが、これがdjangorestframework-3.13.1にアップグレードされてエラーが出なくなった)

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0