Issue
I am trying to install Flask
with the following command:
pip install flask
But pip returns:
Requirement already satisfied: flask in /home/john/anaconda3/lib/python3.11/site-packages (3.0.0)
Requirement already satisfied: Werkzeug>=3.0.0 in /home/john/anaconda3/lib/python3.11/site-packages (from flask) (3.0.1)
Requirement already satisfied: Jinja2>=3.1.2 in /home/john/anaconda3/lib/python3.11/site-packages (from flask) (3.1.2)
Requirement already satisfied: itsdangerous>=2.1.2 in /home/john/anaconda3/lib/python3.11/site-packages (from flask) (2.1.2)
Requirement already satisfied: click>=8.1.3 in /home/john/anaconda3/lib/python3.11/site-packages (from flask) (8.1.7)
Requirement already satisfied: blinker>=1.6.2 in /home/john/anaconda3/lib/python3.11/site-packages (from flask) (1.7.0)
Requirement already satisfied: MarkupSafe>=2.0 in /home/john/anaconda3/lib/python3.11/site-packages (from Jinja2>=3.1.2->flask) (2.1.1)
(I have anaconda and conda installed)
My imports show an error:
All that my code contains is:
from flask import *
Solution
If you have anaconda then you should use conda install <package>
.
If you have downloaded python from the web on the https://www.python.org website (which is what I did), then you should be using python -m pip install <package>
.
I believe that the general rule is this:
Be careful when mixing conda and pip packages, as you can sometimes get dependency conflicts. In general use conda where possible, and pip for packages not available from conda channels.
Answered By - D.L
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.