Each version of python has it's own site-packages set up.
There are several methods that you can use to control this.
My favourite is setting up virtual environments for each project. This assures that all packages will be using the same python version, and thus the same site-packages version.
to set up a virtual environment in any directory, open a command window, change to target window, and from terminal emulator (command window) issue:
Start with:
And this can be made even easier by using pyenv ( see: https://python-forum.io/Thread-pyenv-Sim...Management ) with this installed, you can switch easily from one version of python to another.
Modifying site-packages manually is asking for trouble down the road (just in case you thought about doing that). It might work for a while, but will get you sooner or later. Better to use pip for the proper python version, and letting it install the package.
You can keep a copy of which packages are installed in a particular virtual environment using:
Then if you need to install a newer venv, you can bring it up to date with:
You can see which version of python you are using with
and installed packages for current version with
There are several methods that you can use to control this.
My favourite is setting up virtual environments for each project. This assures that all packages will be using the same python version, and thus the same site-packages version.
to set up a virtual environment in any directory, open a command window, change to target window, and from terminal emulator (command window) issue:
python -m venv myvrtualenviromentname
Start with:
. ./myvrtualenviromentname/bin/activate
(Linux)And this can be made even easier by using pyenv ( see: https://python-forum.io/Thread-pyenv-Sim...Management ) with this installed, you can switch easily from one version of python to another.
Modifying site-packages manually is asking for trouble down the road (just in case you thought about doing that). It might work for a while, but will get you sooner or later. Better to use pip for the proper python version, and letting it install the package.
You can keep a copy of which packages are installed in a particular virtual environment using:
pip freeze > requirements.txt
Then if you need to install a newer venv, you can bring it up to date with:
pip install -r requirements.txt
You can see which version of python you are using with
python -v
pip with pip -V
and installed packages for current version with
pip list