Django Rest Framework — no module named rest_framework

后端 未结 21 811
夕颜
夕颜 2021-02-01 00:23

I\'ve installed django rest framework using pip install djangorestframework yet I still get this error when I run \"python3 manage.py sycndb\":

21条回答
  •  执笔经年
    2021-02-01 00:58

    Maybe you install DRF is for python2, not for python3.

    You can use python console to check your module:

    import rest_framework
    

    Actually you use pip to install module, it will install python2 module.

    You should install the pip for python3:

    sudo apt-get install python3-setuptools
    sudo easy_install3 pip
    

    So, you can install python3 module.

提交回复
热议问题