簡體   English   中英

python3 ModuleNotFoundError:沒有名為“rest_framework_jwt”的模塊

[英]python3 ModuleNotFoundError: No module named 'rest_framework_jwt'

我想從 jwt 導入,但在第 12 行出現錯誤,來自 rest_framework_jwt.settings import api_settings ModuleNotFoundError: No module named 'rest_framework_jwt'

對於蟒蛇 3

pip3 install djangorestframework-jwt

對於 python 2 和 python

pip install djangorestframework-jwt

驗證您的安裝,它是一個單獨的包: pip install djangorestframework-jwt

此外,嘗試將其包含在 settings.py 中: REST_FRAMEWORK = { 'DEFAULT_PERMISSION_CLASSES': ( 'rest_framework.permissions.IsAuthenticated', ), 'DEFAULT_AUTHENTICATION_CLASSES': ( 'rest_framework_jwt.authentication.JSONAuthentication.JSONWebframeAuthentication' , 'rest_framework.authentication.BasicAuthentication', ), }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM