I had a similar case, and here is how I solved it with using pyenv to install different versions of the Python interpreter and venv to create a virtual environment.
Here is a workflow that you can give it a try:
Install pyenv
Here is a Arch Linux way of installing pyenv, and you can change the way you install it according to your operating system.
yay -S pyenv
Init pyenv for your shell
Do the things in the output after running the following command in your terminal. (In my case, edit the .zshrc file)
pyenv init
Install a new version of Python with pyenv install
Install the desired Python version with pyenv. I'll be installing version 3.10 you can change it according to your case.
pyenv install 3.10
Check version before the next step which is going to run shell command
python --version
Change your shell's Python version
Use pyenv shell to make your shell be set to the new version. This is not going to change your global settings of Python.
pyenv shell 3.10
Check the version (confirm it is changed when you compare with the previous check)
python --version
Create virtualenv (Python +3.6)
Go to the desired location (/path/to/your/project).
cd /path/to/your/project
Create the virtual environment in the location.
python -m venv .venv
Activate your virtual environment
source .venv/bin/activate
Confirm its version (it should be different than you global and be same with the version that you set with pyenv shell)
python --version
Close the current shell and open a new one. Then confirm global version of Python. By this way we'll make sure that our global system is not effected.
python --version
Go to the project directory
cd /path/to/your/project
Activate the venv
source .venv/bin/activate
Check the version (confirm it is different than the global version)
python --version
And you are all good!