Octoprint not starting after upgrading to python 3.13.7

What is the problem?

I installed python 3.13.7 after the notification about the old python being deprecated. Now octoprint will not start.

I have tried to run octoprint from the command line, but bash reports it does not exist. Running it as "Python3 octoprint" returns:

Traceback (most recent call last):
  File "/home/pi/oprint/bin/octoprint", line 3, in <module>
    from octoprint import main
ModuleNotFoundError: No module named 'octoprint'

python -VV displays: Python 3.13.7 (main, Oct 1 2025, 19:51:28) [GCC 10.2.1 20210110]

I have rebooted the pi several times.

The OctoPrint web page says the server is not running, and try safemode -it fails.

When I ssh into the pi, I get the following message:

Linux pi4 6.1.21-v7l+ #1642 SMP Mon Apr  3 17:22:30 BST 2023 armv7l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Wed Oct  1 21:03:03 2025 from 192.168.1.171
Traceback (most recent call last):
  File "<string>", line 1, in <module>
    from octoprint.util.version import get_octoprint_version_string; print(get_octoprint_version_string())
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/oprint/lib/python3.13/site-packages/octoprint/util/__init__.py", line 35, in <module>
    from octoprint.util.connectivity import ConnectivityChecker  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/oprint/lib/python3.13/site-packages/octoprint/util/connectivity.py", line 9, in <module>
    from octoprint.util.net import resolve_host, server_reachable
  File "/home/pi/oprint/lib/python3.13/site-packages/octoprint/util/net.py", line 10, in <module>
    import netifaces
ImportError: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.34' not found (required by /home/pi/oprint/lib/python3.13/site-packages/netifaces.cpython-313-arm-linux-gnueabihf.so)
------------------------------------------------------------------------------
Access OctoPrint from a web browser on your network by navigating to any of:

    http://pi4.local
    http://192.168.1.138
    http://192.168.1.78
    http://[2001:818:e25c:5100:c8b0:4a49:8b26:5298]
    http://[2001:818:e25c:5100:1131:d4c0:d234:bc55]

https is also available, with a self-signed certificate.
------------------------------------------------------------------------------
OctoPrint version : unknown
OctoPi version    : 1.0.0
------------------------------------------------------------------------------

What did you already try to solve it?

I tried to recreate the venv but it failed. I created a new venv with:
./octoprint-venv-tool create-venv /home/pi/oprint --ignore-plugin-errors --python /usr/local/bin/python3.13
No errors.

Have you tried running in safe mode?

I cannot start octoprint to set safe mode.

Did running in safe mode solve the problem?

n/a

Systeminfo Bundle

I cannot access octoprint server to create a bundle.

Additional information about your setup

I had the latest OctoPrint and OctoPi versions installed

How did you install Python, from what source?

Because something apparently went wrong there, as this

ImportError: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.34' not found (required by /home/pi/oprint/lib/python3.13/site-packages/netifaces.cpython-313-arm-linux-gnueabihf.so)

Indicates it's pulling in packages for the wrong ABI. Usually with an error like that I'd lean towards a broken package from piwheels these days, but things install and build just fine in the nightly canary builds at the moment created exactly to detect issues like broken piwheels packages, so that cannot be it.

We had this same report from WildRikku on Discord here. He ended up just downgrading back to python 3.11.

Yeah, just also saw the mention of netifaces in Updated Octoprint today, and now it won't start - #18 by foosel and am currently trying to reproduce the issue in a container.

My money is on the trixie targeting package builds on piwheels being the issue, because the bookworm and bullseye packages are fine, but the pi will still go to piwheels for 3.13 Python even when it's running under anything else but trixie.

Hi Gina,

I upgraded using these commands which I found on a raspberry pi forum. I did not want to re-flash my os as is it is running from an ssd.

cd /usr/src
sudo wget https://www.python.org/ftp/python/3.11.9/Python-3.13.7.tgz
sudo tar xzf Python-3.13.7.tgz
cd Python-3.13.7
sudo apt install -y build-essential libssl-dev zlib1g-dev libncurses5-dev
libffi-dev libsqlite3-dev libreadline-dev libbz2-dev
sudo ./configure --enable-optimizations
sudo make -j$(nproc)
sudo make altinstall

It ran for a while but no error messages.

Thanks for the prompt response.

I just added a big warning against doing this to the faq item on updating python:

That also contains a possible workaround: disabeling piwheels at the cost of really increased update and plugin install times.

Given that the underlying Debian release of your install will even stop getting security updates in August next year, I strongly recommend you try your luck with a dist-upgrade or better yet a reflash.

OctoPi 1.0.0/Debian Bullseye with Python 3.13 is a runtime environment I cannot support.

I re-flashed my ssd with the latest release: v 1.11.3 on OctoPi 1.1.0 Python is Python 3.11.2

So hopefully stable for another year or so.

Thanks for a great product, it makes printing so much easier.