This is essentially the opposite of this problem: Import module works in terminal but not in IDLE
If I start a python session and try to import flask, then it works just fine. Despite that, if I just run flask
from the terminal, it is not recognized.
I have confirmed that the locations which pip
installs to is on my system path. (I'm on Windows 10 and I typed $Env:Path
into Powershell to see that, for example, C:UsersackAppDataRoamingPythonPython37site-packages
is in the system path.)
I am also sure that I did pip install --user flask
not inside a virtual environment. When I run import flask; print(flask.__file__
I see C:UsersackAppDataRoamingPythonPython37site-packages
)
Any other ideas for what could be going wrong?
Edit: I'm trying to run flask run
. To check the path python
uses, I did (in python) import sys; for i in sys.path: print(i)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…