OctoPrint tells me my Python environment is outdated and will soon no longer be supported, how do I upgrade?

OctoPi is a separately maintained project, that currently has a 1.1.0rc version available that has an updated python contained within.

For the record, security support for 3.9 is still available, by current knowledge until Oct 31st 2025, and as mentioned, @guysoft is currently also in the process of RC testing the next OctoPi release that ships with Python 3.11.2.

And as far as it is in my power, I'll do my best to support even EOL python versions until easy alternatives are there.

octoprint-venv-tool recreate-venv /path/to/your/venv --python /path/to/python

Although I have no idea where the virtual environment was installed in the first place
Python3 on the other hand is located at /usr/bin/python3

Thanks for your work here, a timely reminder to do backups, replace the SD card, and generally refresh things. New card, imaged, run up, restored in about 20 minutes, give or take. Really painless for what is a bit of a major usually! Thanks!

OctoPi is telling me that I need to update Python (I'm running Python 3.7.3). I followed your advice to flash the latest version of OctoPi using the Raspberry Pi imager to an SD card but the version of Python still shows 3.7.3. Am I missing something?

It's possible the image is cached inside your pi imager and not downloading the updated 1.1.0 version.

  1. Close Pi imager if open.
  2. Open File Explorer and navigate to C:\Users\<username>\AppData\Local\Raspberry Pi\Imager\cache.
  3. Delete the lastdownload.cache file:

Thanks for the suggestion. I'm on a Mac so the file path didn't work for me. I did try looking through the Application Support folders and Library folders and found a prefs file for Raspberry Pi Imager but trashing that didn't fix the problem. I'll post a solution if I find one.

"octoprint-venv-tool recreate-venv /path/to/your/venv --python /path/to/python"
??
I have installed python 3.13, so I guess the path to python is "/usr/bin/python3"
But I have no idea, where the path for the octoprint environment is! Can anybody tell me where it is?
Thanks!

1 Like

This depends on how you installed OctoPrint. Standard OctoPi image this path is ~/oprint/.

octoprint-venv-tool recreate-venv /home/pi/octoprint --python /usr/bin/python3.13
doesn't work, neither with nor without sudo.
Error: "no authorisation" or "command not found"
2025-06-04 migration errors

At no point did the instructions say to use sudo, and that will actually break things. Also noticed you didn't use the correct path in the command. Try this command.

./octoprint-venv-tool recreate-venv /home/pi/oprint --python /usr/bin/python3.13

Thanks for this correction. :smiley:
This update is driving me crazy. :exploding_head:

Sudo or no sudo - I've tried both because nothing works. It happens often enough that sudo is omitted in descriptions even though it is required.
Python 3.13 is installed, but /usr/bin/python3.13 does not exist.
This means that the command does not work as specified:
./octoprint-venv-tool recreate-venv /home/pi/oprint --python /usr/bin/python3.13
--->Error running recreate-venv: [Errno 2] No such file or directory: '/usr/bin/python3.13'
2025-06-06 migration errors2

if you type python --version and python3 --version what is listed? if either of those return 3.13, then you can type which python or which python3 to get the path to that specific binary.

I was about to say: You made my day (and many others).

The binary for python 3.13 is /usr/local/bin/python3.13- for whatever reason.

Now I could start the migration - but unfortunately it cancelled again with an error:

> Error running recreate-venv: Command '('/home/pi/oprint/bin/python', '-m', 'pip', 'install', 'https://github.com/cmuche/octoprint-timelapseplus/archive/master.zip')' returned non-zero exit status 1.

Looks like it hung up on timelapse plus plugin, but OctoPrint was installed.

After what felt like 100 attempts, I managed to perform the migration twice in total.

Previously I had to remove almost all 3rd party plugins.

Octoprint is running - but: I can no longer log in to Octoprint with the Octoprint user/password, the password is now invalid!

What now?
20250610 WrongUsernameOrPasswordAfterMigration

Whew! With the help of ChatGpt, I was able to create a new user and log in again.

jneilliii and ChatGpt, you saved me, thanks for your patience!

Simple search here would have helped too.

Ok, but I haven't forgotten it, it was just no longer valid - for whatever reason.
Anyway, the problem is solved