Issue
I want to run a very simple application using Flask
framework. I have also run and developed flask app before. After a while I need to develop a new simple app using it.
So I have created a virtual environment and activated it:
virtualenv venv
source venv/bin/activate
python --version # prints 3.8.6
pip --version # prints pip 20.3.1
Then installed Flask
:
(venv) pip install -U Flask
Here is my hello world
code:
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello, World!"
Whenever I run flask run
command I face to the following error:
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (PyJWT 2.0.0 (/home/user/.local/lib/python3.8/site-packages), Requirement.parse('PyJWT<2.0,>=1.6.4'), {'Flask-JWT-Extended'})
I have also seen the similar links which I refer them below but I didn't get any clue about how resolving it.
P.S It is notable that I have tried installing different version of PyJWT like 1.7.1
, 2.0.0
, etc. but none of them worked properly.
Solution
It seems that the newest version of Flask
(currently 2.0.1) has problem with dependencies.
The problem was resolved after downgrading it to 1.1.2
via the following command:
pip install Flask==1.1.2
Hope it will be fixed in near future!
Answered By - Mostafa Ghadimi
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.