File "c:\Users\kally\rest\code\app.py", line 3, in <module>
from flask_jwt import JWT
File "C:\Users\kally\AppData\Roaming\Python\Python310\site-packages\flask_jwt\__init__.py", line 16, in <module>
import jwt
File "C:\Users\kally\AppData\Roaming\Python\Python310\site-packages\jwt\__init__.py", line 19, in <module>
from .api_jwt import (
File "C:\Users\kally\AppData\Roaming\Python\Python310\site-packages\jwt\api_jwt.py", line 5, in <module>
from collections import Mapping
ImportError: cannot import name 'Mapping' from 'collections' (C:\Program Files\Python310\lib\collections\__init__.py)
i was creating a REST api using flask and while i was about to test it on postman I saw that error
730 Views Asked by Gabriel kalango At
2
There are 2 best solutions below
2
Patrick Artner
On
Expanding on my comment:
As described in the documentation, Mapping was moved to collections.abc in v3.3 and is deprecated since v3.9 (while still left visible for backwards compatability until v3.8).
Your error stems from using outdated imports - you would need to upgrade the used pyjwt/jwt - especially its /api_jwt.py. The current version of
https://github.com/jpadilla/pyjwt/blob/master/jwt/api_jwt.py
uses the correct imports since this commit in November 2018.
Related Questions in PYTHON
- How to store a date/time in sqlite (or something similar to a date)
- Instagrapi recently showing HTTPError and UnknownError
- How to Retrieve Data from an MySQL Database and Display it in a GUI?
- How to create a regular expression to partition a string that terminates in either ": 45" or ",", without the ": "
- Python Geopandas unable to convert latitude longitude to points
- Influence of Unused FFN on Model Accuracy in PyTorch
- Seeking Python Libraries for Removing Extraneous Characters and Spaces in Text
- Writes to child subprocess.Popen.stdin don't work from within process group?
- Conda has two different python binarys (python and python3) with the same version for a single environment. Why?
- Problem with add new attribute in table with BOTO3 on python
- Can't install packages in python conda environment
- Setting diagonal of a matrix to zero
- List of numbers converted to list of strings to iterate over it. But receiving TypeError messages
- Basic Python Question: Shortening If Statements
- Python and regex, can't understand why some words are left out of the match
Related Questions in FLASK
- How to store a date/time in sqlite (or something similar to a date)
- Authenticate Flask rest API
- How can I update my Python app so my Flask function sends information to JavaScript without breaking the loop?
- How to create a route on a web map (Flask) using folium and osmnx?
- for some reallly odd reason css doesen't apply
- Sigma.JS custom rendering
- Unable to find any supported Python versions
- Flask Application Testing with pytest Returns 404 for Routes
- flask keep a user logged in across browser sessions
- database login.py and register.py error showing 404 file not found and doesn't work
- Synology DSM 7.2: how do I fix a virtual server error page for a Flask application?
- Frontend fetching data from unexpected localhost address despite proxy configuration
- Trouble Extracting Request Body in Flask-Lambda Application Deployed on AWS Lambda via AWS SAM
- Page refreshes on POST request
- Handling Irrelevant Uploads in Flask Application for Bone Fracture Detection
Related Questions in FLASK-RESTFUL
- How To Call Zerodha API In Flask
- How to generate crud methods for flask_restful resource classes
- Trouble Deploying Flask-Based Machine Learning Model to Vertex AI Endpoint with Custom Container
- How do I solve flask authentication?
- How can I access the flask.g variable from within a logging filter in Flask? And if not possible, how can I store/access a request scoped value?
- Did not attempt to load JSON data because the request Content-Type was not 'application/json
- Not able to open a link directly in vscode (Windows 11)
- Using flask_restful with flask _jwt for multiple users
- Uncaught (in promise) SyntaxError when console.logging data from my server file
- Access to XMLHttpRequest has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present (axios & flask restful)
- How to make a dockerized keycloak communicate with the flask project on localhost (With CIBA Poll Mode Enabled)
- Flask App on Google App Engine Fails to Fetch Data from Cloud SQL with "500 Server Error"
- React And Flask-login - Check If User Logged In
- Flask + Docker => No connection
- Docker container giving 404 on every request
Related Questions in FLASK-JWT
- Request.endpoint is none when bearer token is present
- JWT generated token is invalid
- create a function that generate a JWT token and send to server the server will verify that token and give response if token is valid
- i was creating a REST api using flask and while i was about to test it on postman I saw that error
- how to resolve a TypeError: Object of type ObjectId is not JSON serializable using flask-jwt
- Missing Authorization Header in production only
- Flask-jwt installed but it's showing Not Found / Not installed
- How to pass jwt token from one route to another?
- Flask JWT with RESTful api
- How to fetch Authorization header token to logout JWT Flask ReactJs
- TypeError: Expecting a string- or bytes-formatted key
- Authentication with Flask JWT in python
- Flask-JWT-Ext get_current_user(), get_jwt_identity() returns None despite having tokens
- How to set a custom authorization response in Flask-JWT?
- Get flask jwt token identity in other methods
Related Questions in PYTHON-3.10
- Why is easygraphics only giving me a blank screen in RENDER_MODE_AUTO?
- Drop in r2 score when trying out Xgboost in different versions of python
- Illegal instruction (core dumped) while runing # rasa init cmd and unable to genrate a model or train it
- How to add a new field in the Odoo's CRM lead view?
- SSL Certi1ficate Issue: certificate verify failed: self-signed certificate in certificate chain
- DeepXDE: Cannot feed value of shape (5950, 2) for Tensor Placeholder_86:0, which has shape (None, 278)
- How can I optimize my sieve of Eratosthenes?
- Python numpy set random seed, thread-safe
- Python3 conversion from pysqlcipher3 to sqlite3 module has error when attaching database
- Using microsoft azure eventgrid trigger output binding, how to support cloudEvent Schema 01
- How do I extract and display the sum of string values from a specific column of csv file separately?
- How to draw a moving line as slider for the image comparison video generator script in Python with FFmpeg
- Show 2 plots at the same time
- Why I cannot type a `list` parameter in a class with an existing `list` method
- Changing the way text is displayed for QLineEdit
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
That error
is saying to you, that there is no
Mappingincollectionpackage. Please check doc