The OctoPrint server is currently not running after update to 1.8.7 - Fatal Python error

What is the problem?

Seeing " The OctoPrint server is currently not running" screen.
The suggested

pi@bender:~ $ ps -ef | grep -i octoprint | grep -i python

command doesn't do anything.
Logging in via PuTTY gives the following:

Error processing line 1 of /home/pi/oprint/lib/python3.9/site-packages/_virtualenv.pth:

Fatal Python error: init_import_site: Failed to import the site module
Python runtime state: initialized
Traceback (most recent call last):
File "/usr/lib/python3.9/", line 175, in addpackage
File "", line 1, in
File "/home/pi/oprint/lib/python3.9/site-packages/", line 40, in
from functools import partial
File "/usr/lib/python3.9/", line 18, in
from collections import namedtuple
ImportError: cannot import name 'namedtuple' from 'collections' (unknown location)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.9/", line 606, in
File "/usr/lib/python3.9/", line 589, in main
known_paths = venv(known_paths)
File "/usr/lib/python3.9/", line 521, in venv
addsitepackages(known_paths, [sys.prefix])
File "/usr/lib/python3.9/", line 376, in addsitepackages
addsitedir(sitedir, known_paths)
File "/usr/lib/python3.9/", line 214, in addsitedir
addpackage(sitedir, name, known_paths)
File "/usr/lib/python3.9/", line 185, in addpackage
import traceback
File "/usr/lib/python3.9/", line 5, in
import linecache
File "/usr/lib/python3.9/", line 8, in
import functools
File "/usr/lib/python3.9/", line 18, in
from collections import namedtuple
ImportError: cannot import name 'namedtuple' from 'collections' (unknown location)

Access OctoPrint from a web browser on your network by navigating to any of:


https is also available, with a self-signed certificate.

This image comes without a desktop environment installed because it's not
required for running OctoPrint. If you want a desktop environment you can
install it via

sudo /home/pi/scripts/install-desktop

OctoPrint version : unknown
OctoPi version : 1.0.0

What did you already try to solve it?

Rebooted RasPi - same result.
Complete wipe and fresh reinstall of OctoPrint 1.8.7 from RasPi Imager - appeared to work fine for a few days, but now (logging in for first time in a couple of weeks) back to not running again.
Rebooted RasPi - same result.
Attempted to force reinstall - gives exactly the same block of error messages as above:

pi@bender:~ $ ~/oprint/bin/pip install --force-reinstall OctoPrint==1.8.7 --no-cache-dir
Error processing line 1 of /home/pi/oprint/lib/python3.9/site-packages/_virtualenv.pth:

Have you tried running in safe mode?


pi@bender:~ $ octoprint safemode
-bash: octoprint: command not found


pi@bender:~ $ octoprint config set --bool server.startOnceInSafeMode true
-bash: octoprint: command not found

Did running in safe mode solve the problem?

n/a - couldn't get it to run.

Systeminfo Bundle

You can download this in OctoPrint's System Information dialog ... no bundle, no support!)

Can't get at bundle as can't log in to OctoPrint.
Retrieved latest log using WinSCP: octoprint.log (10.1 KB)

Additional information about your setup

OctoPrint version, OctoPi version, printer, firmware, browser, operating system, ... as much data as possible

OctoPrint 1.8.7, OctoPi 1.0.0, Prusa MK3 fw3.10.0, Raspberry Pi 3 Model B Plus Rev 1.3

Not sure if this is a python bug (not seeing anyone else complaining of the same thing) - is it more likely a corrupted SD card - i.e. just try another? Any suggestions much appreciated.
Kind regards,

Log in with putty and do a df -h and let us know what that shows. Sounds like your SD card has no space left on it. What size SD card is it?

Thanks @5ft24

It's an 8GB, and looks to have plenty of space as far as I can see...

Filesystem Size Used Avail Use% Mounted on
/dev/root 7.1G 2.3G 4.5G 34% /
devtmpfs 307M 0 307M 0% /dev
tmpfs 436M 0 436M 0% /dev/shm
tmpfs 175M 964K 174M 1% /run
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
/dev/mmcblk0p1 255M 50M 206M 20% /boot
tmpfs 88M 0 88M 0% /run/user/1000

Still shows 4.5G free. Shouldn't be an issue. Do you have another SD card you can try and see if it happens on it?

Thanks. Reinstalled using a new SD card. Looks okay so far, but the previous one did too for a few days, so will see how it gets on over the next week or two.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.