I’m trying to run Stable Diffusion and keep getting errors due to running python3.8.18 when I need to run at least python3.9 but nothing I do changes my python version.
I’ve tried using Conda, my package manager, exporting the path of the higher version, uninstalling Python, uninstalling python3, upgrading, and force updating. Nothing works. I always get Python 3.8.18 when I run python --version
.
I have the Deadsnakes repo and still can’t use it without invoking it directly. It still has the same output when I check the version, even in a new environment.
2
Answers
Im guessing from your post you tried:
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.9
If this doesn’t work: i would try
sudo update-alternatives –list python3
sudo update-alternatives –install /usr/bin/python3 python3 /usr/bin/python3.9 1
sudo update-alternatives –config python3
and then click python 3.9
I would suggest you use
pyenv
to install the specific version of python you need, then create avirtual environment
using the python version for each project. This both prevents you from breaking yuour system python (that may be used by other packages) and allows you to work on different projects that may have conflicting requirements.Full instructions for installing can be found at https://github.com/pyenv/pyenv
One of the options is:
Then to install the version you need
Then you need to create a virtual env for you project
Now when you type
python --version
it should be the version you need.