Octoprint won't start - No module named 'zipstream.ng'

What is the problem?

I leave my Raspberry Pi running all the time. A print completed normally in my absence. I found that the octoprint web interface was unavailable. I don't believe that the pi was ungracefully restarted.

Output of the 'octoprint' command ALWAYS returns:

Traceback (most recent call last):
  File "/usr/local/bin/octoprint", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/dist-packages/octoprint/__init__.py", line 1006, in main
    from octoprint.cli import octo
  File "/usr/local/lib/python3.9/dist-packages/octoprint/cli/__init__.py", line 347, in <module>
    from .systeminfo import cli as systeminfo_commands  # noqa: E402
  File "/usr/local/lib/python3.9/dist-packages/octoprint/cli/systeminfo.py", line 10, in <module>
    from zipstream.ng import ZIP_DEFLATED, ZipStream
ModuleNotFoundError: No module named 'zipstream.ng'

This message occurs with any ivocation of 'octoprint' including 'systeminfo' and 'safemode'

What did you already try to solve it?

Restarting the service. no different. I followed some other forum advice to reinstall octoprint.

source ~/oprint/bin/activate
pip install --force-reinstall OctoPrint

Have you tried running in safe mode?

yes. any invocation of octoprint returns this:

pi@ender3:~/.octoprint/logs $ octoprint safemode
Traceback (most recent call last):
  File "/usr/local/bin/octoprint", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/dist-packages/octoprint/__init__.py", line 1006, in main
    from octoprint.cli import octo
  File "/usr/local/lib/python3.9/dist-packages/octoprint/cli/__init__.py", line 347, in <module>
    from .systeminfo import cli as systeminfo_commands  # noqa: E402
  File "/usr/local/lib/python3.9/dist-packages/octoprint/cli/systeminfo.py", line 10, in <module>
    from zipstream.ng import ZIP_DEFLATED, ZipStream
ModuleNotFoundError: No module named 'zipstream.ng'

Did running in safe mode solve the problem?

No change

Systeminfo Bundle

I can't pull a systeminfo bundle because the octoprint command always throws the zipstream error.

Additional information about your setup

I think this is v1.9.2

'octoprint version' throws the same error.

Have you checked the SD card? How full is it?

Here's the SD stats

(oprint) pi@ender3:~ $ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        29G  4.7G   23G  17% /
devtmpfs        642M     0  642M   0% /dev
tmpfs           900M     0  900M   0% /dev/shm
tmpfs           360M  1.1M  359M   1% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
/dev/mmcblk0p1  255M   51M  205M  20% /boot
tmpfs           180M     0  180M   0% /run/user/1000

Tried installing zipstream-ng to no avail. I'm unsure about the invalid distribution issue. I haven't done anything but install this from the rpi imager and use it for several months. I haven't been mucking around with python packages.

pi@ender3:~ $ source  ~/oprint/bin/activate
(oprint) pi@ender3:~ $ pip install zipstream-ng
WARNING: Ignoring invalid distribution -ebassets (/home/pi/oprint/lib/python3.9/site-packages)
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: zipstream-ng in ./oprint/lib/python3.9/site-packages (1.6.0)
WARNING: Ignoring invalid distribution -ebassets (/home/pi/oprint/lib/python3.9/site-packages)

More digging - I'll eventually mess this up enough to have to reimage it from scratch.

(oprint) pi@ender3:~ $ ls -a /home/pi/oprint/lib/python3.9/site-packages | grep "^~"
~ebassets
~ebassets-2.0.dist-info
(oprint) pi@ender3:~ $ rm -fr /home/pi/oprint/lib/python3.9/site-packages/~ebassets*
rm: cannot remove '/home/pi/oprint/lib/python3.9/site-packages/~ebassets/six.py': Permission denied
...
rm: cannot remove '/home/pi/oprint/lib/python3.9/site-packages/~ebassets-2.0.dist-info/LICENSE': Permission denied

(oprint) pi@ender3:~ $ sudo rm -fr /home/pi/oprint/lib/python3.9/site-packages/~ebassets*
(oprint) pi@ender3:~ $ pip install zipstream-ng
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: zipstream-ng in ./oprint/lib/python3.9/site-packages (1.6.0)
(oprint) pi@ender3:~ $ pip install zipstream-ng --force-reinstall
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting zipstream-ng
  Using cached https://www.piwheels.org/simple/zipstream-ng/zipstream_ng-1.6.0-py3-none-any.whl (22 kB)
Installing collected packages: zipstream-ng
  Attempting uninstall: zipstream-ng
    Found existing installation: zipstream-ng 1.6.0
    Uninstalling zipstream-ng-1.6.0:
ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/home/pi/oprint/lib/python3.9/site-packages/zipstream/__init__.py'
Check the permissions.

(oprint) pi@ender3:~ $ sudo pip install zipstream-ng --force-reinstall
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting zipstream-ng
  Using cached https://www.piwheels.org/simple/zipstream-ng/zipstream_ng-1.6.0-py3-none-any.whl (22 kB)
Installing collected packages: zipstream-ng
  Attempting uninstall: zipstream-ng
    Found existing installation: zipstream-ng 1.6.0
    Uninstalling zipstream-ng-1.6.0:
      Successfully uninstalled zipstream-ng-1.6.0
Successfully installed zipstream-ng-1.6.0

(oprint) pi@ender3:~ $ octoprint
Traceback (most recent call last):
  File "/home/pi/oprint/bin/octoprint", line 8, in <module>
    sys.exit(main())
  File "/home/pi/oprint/lib/python3.9/site-packages/octoprint/__init__.py", line 1006, in main
    from octoprint.cli import octo
  File "/home/pi/oprint/lib/python3.9/site-packages/octoprint/cli/__init__.py", line 347, in <module>
    from .systeminfo import cli as systeminfo_commands  # noqa: E402
  File "/home/pi/oprint/lib/python3.9/site-packages/octoprint/cli/systeminfo.py", line 10, in <module>
    from zipstream.ng import ZIP_DEFLATED, ZipStream
ModuleNotFoundError: No module named 'zipstream.ng'
(oprint) pi@ender3:~ $

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