ModuleNotFoundError: No module named 'flask_sqlalchemy - flask-sqlalchemy

I am getting this error when i try to run:
flask db upgrade
from flask_sqlalchemy import SQLAlchemy
ModuleNotFoundError: No module named 'flask_sqlalchemy'
I verified that flask-sqlalchemy is already installed:
Requirement already satisfied: flask-sqlalchemy in ./venv/lib/python3.6/site-packages (2.4.4)

Are you using the correct version of Python? By installing flask_sqlalchemy and using Python3, make sure you install the module by typing pip3 install flask-sqlalchemy, so the module gets installed in Python3 and not another version. If you want to use Python2, make sure using the normal command pip install flask-sqlalchemy.

Related

ModuleNotFoundError: No module named 'matplotlib.colorbar'

I tried upgrading my matplotlib to the 3.4.2 version. I first did
pip install matplotlib==3.4.2
It successfully installed. But when I try and import the package in Jupyter, it gives me an error
ModuleNotFoundError: No module named 'matplotlib.colorbar'
I have tried to uninstall matplotlib and then install again using
pip3 install matplotlib
But I get the same error. Also in my Anaconda Navigator window I see the older version 3.3.4 still installed

install "pip undetected-chromedriver" for selenium python

I'm trying to make an autofiller using selenium, but it couldn't be done. so I decided to use undetected chromedriver to finish the automation.
I am having some difficulty here to import the undetected-chromedriver.
I already downloaded it by inputting the command line: pip install undetected-chromedriver
But when I put the import undetected_chromedriver as uc, the complier doesn't recognize it.
Below is the Error message after trying to import undetected-chromedriver:
import undetected_chromedriver as uc
ModuleNotFoundError: No module named 'undetected_chromedriver'
Use the following command to check if the undetected_chromedriver package is in the list
pip list
or
pip3 list
Try the following
# navigate into the project directory with your python script
cd presearch
# create virtual environment
python3 -m venv venv
# activate the virtual environment
source venv/bin/activate
# install required pip packages
pip3 install undetected-chromedriver
If you have multiple python versions installed, you might check if you actually installed it in the right one.

How to install numpy on vscode on mac?

It's saying:
"ModuleNotFoundError: No module named 'numpy'"
and then when I do "pip install numpy" it says:
Requirement already satisfied: numpy in ./Library/Python/2.7/lib/python/site-packages (1.16.6)"
Probably you are using python 3.X while pip is configured for python 2.X.
Try running pip3 install numpy
Basically you are installing a package for python 2, while running the script with python 3.

Pandas giving me an import error for Datautil?

I am trying to import the pandas module. However, when attempting to run my code, I get the following error:
raise ImportError('dateutil 2.5.0 is the minimum required version')
ImportError: dateutil 2.5.0 is the minimum required version
However, I already have the 2.5.0 verison on my computer, as seen from the following message when attempting to pip install.
Requirement already satisfied: python-dateutil in /Users/nat/Library/Python/3.5/lib/python/site-packages (2.5.0)
Does anyone have any suggestions on what could be the problem?
Try installing below package,
pip install python-dateutil==2.5.0

No module named jinja2

Im trying to deploy a Python3.2 app in my Ubuntu 12.04 server. Everything was fine, until I tried to use Jinja2 as my template system.
Im using virtualenv to use Pyhon3.2 instead of Python2, and I've installed other required libraries such as pymongo or bottle without problem. But now, my app fails because it says
ImportError: No module named jinja2
I've installed jinja2 the same way as I installed pymongo or bottle (using pip in the virtualenv), and they work just fine. If I try to install it again:
./virtualenv/bin/pip-3.2 install jinja2
Requirement already satisfied (use --upgrade to upgrade): jinja2 in /var/www/virtualenv/lib/python3.2/site-packages
Cleaning up...
It says that it is installed. I've tried to uninstall and install again with no luck.
Im trying to run the application using mod_wsgi, and I know it's using the right virtualenv, because I don't get any errors due to Pymongo, Bottle, what are installed using the virtualenv pip.
Any ideas? :(
Jijna is not compatible with Python 3.2. See this