Upgrade your OctoPrint install to Python 3!

@Niamh - Filament manager got taken over by @OllisGit yesterday (maybe the day before), so you're in luck!

Release notes :point_right: https://github.com/OllisGit/OctoPrint-FilamentManager/releases/tag/1.6.0

You should get a notice that it has been transferred, but you need to reinstall as the updates are looking in the wrong place. See plugin notices if you don't get it, at the bottom Plugin notices

OK, so just uninstall the existing filament manager ten install the new one?

If you go to Settings > Plugin Manger > Get More then find 'Filament Manager' there should be a reinstall button beside it :slightly_smiling_face: you may need to check it is not filtered on installed plugins only.

Or if you can't find that, uninstall without cleaning data (you'll lose all your config) then install it again.

I am running .17. I rcvd this error:

E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/dpkg/status
E: The package lists or status file could not be parsed or opened.
ERROR: failed to update package list
Please try manually

Cleaning up...
Fatal error: Exiting

Try updating the package list manually, with sudo apt-get update, that seems an issue with your OctoPi installation - nothing I can do about that.

Also check it is connected to the internet, then if you still need help solving the problem please open a separate topic in 'Get help'.

Definitely connected to the internet
pi@octopi:~ $ sudo apt-get update
[sudo] password for pi:
Get:1 http://raspbian.raspberrypi.org/raspbian buster InRelease [15.0 kB]
Hit:2 http://archive.raspberrypi.org/debian buster InRelease
Fetched 15.0 kB in 1s (13.8 kB/s)
Reading package lists... Error!
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/dpkg/status
E: The package lists or status file could not be parsed or opened.

Thanks for the upgrade script.
I found that I had 3 plugins that used python V2, so deleted them first.
The upgrade script worked flawlessly :slight_smile:

I now just have to wait for the plugin owners to upgrade their pplugins to V3

cheers
ian

1 Like

I wish these 4 plugins would be upgraded to python 3

  • LayerDisplay (0.4.3) from Matt Thompson
  • OctoKlipper (0.2.5) from Martin Muehlhaeuser
  • Terminal Commands (0.1.6) from ieatacid
  • Webcam Tab (0.1.2) from Sven Lohrmann
    most importantly the Octoklipper plugin.

EDIT: Whoahh, I just realised that after removing the Octoklipper 0.2.5 plugin I could install the 0.3.1 version from Alice Weigt, which is python 3 compatible!!!
Hope that helps anyone
EDIT 2: Success: OctoPrint 1.4.2 Python 3.7.3 OctoPi 0.17.0 (deactivated the three plugins before upgrading with the script).
THANKS

1 Like

Yeah, the Klipper plugin it was adopted officially yesterday. Go and let the plugin authors know that you want Python 3 compatibility, for the others, at some point OctoPrint will drop Py2 support so they need to be made compatible.

On every plugin there is at least one "python 3 upgrade" issue.

my Terminal Commands Extended plugin is Py3 compatible...

1 Like

***Bed Visualizer is gone ***

The Python upgrade worked fine, printing seems to work ( just testing :slight_smile: )

Only I miss the Bed Visualizer, even after installing the plugin again, it does not appear

There should have been a link when installing that plugin that extra action is required. And @jneilliii posted that link in the comments, previously.

1 Like

that worked perfect !!

Many thx

1 Like
21:47 root@pine64 /opt/octoprint# python3 upgrade.py 
This script will only run on python 3.6+
Run using 'python3 upgrade.py'
21:49 root@pine64 /opt/octoprint# python3 --version
Python 3.5.3

@SR-G What do you want help with? Your python 3 version is too old.

Yeah. This should/could have been noted somewhere.

And now (i remember why i hate the python ecosystem - everything related to maintenance of application made with python is just a time sink) ...

Path: /opt/octoprint/venv
Path valid
Config directory: /home/octoprint/.octoprint
Config directory valid

To do the install, we need the service stop and start commands. (Leave blank if you don't have a service set up)
Stop command: systemctl stop octoprint
Start command: systemctl start octoprint
Getting OctoPrint version...
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 163, in _run_module_as_main
    mod_name, _Error)
  File "/usr/lib/python2.7/runpy.py", line 111, in _get_module_details
    __import__(mod_name)  # Do not catch exceptions initializing package
  File "/opt/octoprint/venv/local/lib/python2.7/site-packages/octoprint/__init__.py", line 7, in <module>
    import logging as log
  File "/usr/lib/python2.7/logging/__init__.py", line 26, in <module>
    import sys, os, time, cStringIO, traceback, warnings, weakref, collections
  File "/usr/lib/python2.7/weakref.py", line 14, in <module>
    from _weakref import (
ImportError: cannot import name _remove_dead_weakref
Failed to find OctoPrint install
If you are not on OctoPi, please check you entered the correct path to your virtual environment

And here i have no idea why my paths are not the proper ones.

Thanks a lot. GREAT! Will try it ASAP

That looks like an issue in your installation. Script's trying to run octoprint --version to find it, and that failed. Not sure what to suggest, does OctoPrint run properly normally?

It is right above the command in the blog post.

2 Likes