Reputation: 515
I faced a strange issue: I'm working on a Python/Flask project on my local computer, don't use the virtual env. I installed different modules with pip3, like Flask-SQLAlchemy, Flask-Migrate, etc. Everything worked perfectly.
Suddenly, after a few weeks, when running the program, it started to appear the errors, like ModuleNotFoundError: No module named 'flask_sqlalchemy'
- and the same for Flask-Migrate, Flask-WTF, etc.
The solution is to install all these modules again but with pip (not pip3). Uninstallation/Installation with pip3 does not help. Why did it happen? Is it possible to turn it back to pip3?
I didn't change the environment, I have the only one actually. Using Python 3.8
Upvotes: 0
Views: 47
Reputation: 812
I would say that the reason why it is like this, it's because maybe there is some libraries for other your projects that clash with flask libraries and that's why you have issues. E.g. I had the same issue when I didn't use virtual environments when I was learning Python, and when I had multiple projects with different python libraries, some of them clashed and produced unexpected errors, so I started using virtual environments - different virtual environment for each project and it solved all the problems with clashes between different libraries.
Here is a good official tutorial on how to use virtual environments
Upvotes: 2