Set your own custom venv Python Path

Find current Path for python site-packages

sudo find / -type d -name *flask_sql*
sudo find / -type d -name *site-packages*
sudo find / -type d -name *site-packages* | grep python3*

Find and highlight

sudo find / -type d | grep flask
sudo find / -type d | grep flask_sqlalchemy
sudo find / -type d | grep site-packages/flask
sudo find / -type d | grep /dist-packages/flask

Add your own Python Path

(venv) which python3
cd ~
sudo nano .bashrc
### Setting PATH for my Python 3.7
export PATH="/path/to/bin:/another/path/to/bin:${PATH}"

Confirm the new PATH

which python
which python3

type python
type python3

echo $PATH

You may want to use alias

alias python=python3
alias pip=pip3

Check using which path

python
>>> import sys
>>> sys.path
>>> sys.executable
>>> exit()

pip3 show flask
pip3 show mod_wsgi
pip3 show flask-wtf
pip3 show flask-sqlalchemy

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top