Upgrade your OctoPrint install to Python 3!

If you enter the command(s) you typed as Preformatted text (</> icon above), we might be able to see if there was a typo. Using PuTTY you can cut the command out of this thread and paste it in the SSH terminal window using right-click.

@uppermill - wrong URL, check it.

Should be https://get.octoprint.org/py3/upgrade.py

edit as @b-morgan says, just copy and paste it into an SSH window to get it exactly right

@cmh Thanks for the feedback :smile:

The script has been around in a sort of 'testing' state until now, I first wrote it back in June. There's a couple of forum posts etc. etc. but anyway great to hear it worked well for you.

Worked great! Thanks!!

1 Like

Thanks for the fast responses. I updated the URL and everything has now completed successfully.

1 Like

@Charlie_Powell Sweet, nice and easy, looks good. Pi4, 0.12-0.15 (Can't remember where this started) original install with about 10 plugins and standard updates/upgrades since. Took less than 5 minutes to run and looks to be working fine. Thanks for the sweet script!

1 Like

All went well with the base install, It initially screwed my GPX plugin. I couldn't install the plugin from the plugin manager so installed it manually. Re-created the gpx.ini file and away I went.

I'm running OctoPrint 1.4.2, OctoPi 0.18.0.

Thank you

Yeah, that bug of not being able to install should be fixed in the next release of OctoPrint.

If I were a newbie to Linux then I would have given up, So a message to anyone who is new and cannot follow logs and diagnose issues in Linux I would avoid the upgrade if you have tons of plugins. :slight_smile: But thank you to whoever created this script. I'm guessing @jneilliii?

Nope not me, @Charlie_Powell all the way. He's new on the scene and has quickly become a plugin author (WS281x LED Status) as well as a huge help in discord, here in the forum, and assisting Gina with issue/bug maintenance triage and fixing.

1 Like

Thanks @Charlie_Powell

1 Like

@Charlie_Powell Sorry, that is not correct. Klipper itself is written in Python. Look at this folder:

klippy is the core of Klipper's functionality. Klipper is still based on Python 2.7.There is even a branch of Klipper where work is being done on porting to Python 3, but it's stale. "Master" gets updates on a daily basis, the branch for Python 3 is three months old.

Octoklipper is simply a regular plugin for Octoprint, written by another guy.

It is not necessary for interoperability, but makes configuration of Klipper available through Octoprint which is pretty nice.

The plugin has a fork for Python 3 which seems to work pretty well.

Klipper itself seems quite stuck in 2.7. The maintainers are very active in developing functional improvements, but questions about Python 3 get canned answer. Since it's nothing I need to expose to the internet, that's sort of ok - as long as it stays compatible with my Octopi.

Ah ok, I read the wrong thing (maybe it was the printer firmware side? can't remember!), sorry.

I have done some more poking and it definitely creates its own virtual environment, looked through the install scripts - as good software does - so there should be no issue at all, since we are only touching OctoPrint's environment.

Klipper will still work, since all OctoPi distributions have both Python 2.7 and 3.x installed at a system level - that does not change in the script, the only thing that does is the virtual environment where OctoPrint (not klipper) is installed.

Hope that makes sense.

To add to that: while it is not possible to eg run OctoPrint with Python 3 and a plugin for OctoPrint with Python 2, it is possible to run OctoPrint with Python 3 and Klipper with Python 2 because they are different processes.

3 Likes

Isn't the plug-in for klipper required in order to use klipper?

From what I have heard, no, the plugin is not required. If you do intend to use the plugin with OctoPrint running on Python 3, you must use the Python 3 version of the plugin. However, Klipper itself can be running on Python 2.

Read (and follow) the instructions on upgrading more carefully. The upgrade script is not a plugin, so it should not be installed as a plugin. The upgrade script is something you would run in an SSH session (eg Putty), or using a keyboard and display on the Pi.

1 Like

Is there a python 3 version of the klipper plugin? I can't find one.

@simpat1zq - there will be within the week, its being adopted by someone who has updated it to be Py3 compatible.

@jdcamc I'm not sure what to say.... This is not a plugin, read the instructions, it goes nowhere near the plugin manager.

You can use Octoprint and Klipper without the plugin. The printer-queue is /tmp/primter which looks a bit odd, but for Octoprint, Klipper behaves like a standard printer. It handles the common G-codes like temperature control, G28, G1 and the like. The plugin gives you the capability to edit the Klipper-configuration with data like default acceleration etc from within the browser. This is a huge bonus over Marlin where simple things like configuring ABL require the compilation of a new firmware file.

1 Like