Upgrade your OctoPrint install to Python 3!

Thanks![quote="b-morgan, post:47, topic:23973, full:true"]
@derekpurdy, Yes, there are a couple of ways. If you are running OctoPrint 1.4.2, then the Plugin Manager will show you directly. For 1.4.2 and earlier versions, you can install the plugin Python 3 Check by @jneilliii using the Plugin Manager.

Its homepage is https://github.com/jneilliii/OctoPrint-Python3PluginCompatibilityCheck.
[/quote]

Thanks so much! I see I have a couple, but they aren't so important.

Worked perfectly for me, Thanks!!! OctoPi 0.17.0 / OctoPrint 1.4.2 / Python 3.7.3

1 Like

Hey @Detlev_Rackow
I just had a look at Klipper, and it doesn't run in Python at all. What you may be thinking of is the plugin for OctoPrint for a better (than already functional) integration.

In the coming days the Klipper plugin is being adopted, with the new version already compatible. Once that happens, then you should have no issue upgrading to Python 3.

@coubi64 - that looks like an issue with the specific plugin, (Dashboard) since Resource Monitor updates correctly, whatever is wrong in Dashboard should be reported to the plugin author so they can take a look.

If it is in the next release, I may as well wait for that unless there is an urgent need.

(I am biased) but would it not be fun to have Python 3.7 in the bottom corner of your web interface now. There's also some performance improvements....

I’m sure @jneilliii could have written a plugin in minutes that replaces the text Python 2.7 with Python 3.7 in the UI :wink:

1 Like

now that's funny.

1 Like

True but off-topic story: the very first plugin I published for Cura pretended to offer a way to switch off automatic slicing after making changes. All it did was place a white rectangle over the slicing progress bar so you would not see the slicing taking place. I got actual users telling me how much it sped up Cura. (Since then the plugin has been rewritten to actually do what it promised)

1 Like

This


made me smile, but the next one,

made me laugh properly!

1 Like

I started the upgrade-script on my Octopi 0.17 with Octoprint 1.4.12.

I confimed all prompts with enter, and entered my password when prompted in order to install python3-dev. Immediately after entering my password, the putty-session was terminated by the host.

Octoprint continued to work. I tried to restart the script, after entering my password for Python3-dev I got a cryptic message about wrong data in the stream.

Next step was to download and start the downgrade-script, which failed, claiming there is no data in the backup path.

At this point, my Octoprint installation does no longer work. The server is reachable via SSH, but Octoprint is not running.

When I ssh into the system, I see:


OctoPrint version : unknown
OctoPi version : 0.17.0

What is the best way to recover? I have an almost up-to-date backup of my Octoprint config, and I can backup my Klipper-config.

Best,

Detlev

Found the solution lol...just need to reboot the pi...and the 2nd instance is up again... :wink:

@Detlev_Rackow - could you open a separate topic, so I can discuss it through with you, and get a solution - it is fully possible to recover, since nothing of the old install gets deleted.

Easier than the comments of this post, where discussion gets confusing with many people.

Funny, I made a super half-hearted investigation to switch to Python 3 just last week. Saw it wasn't super easy and gave up. Then this post came out. Ran it on my most recent of three OctoPi 0.17 installs and it was super easy. No problems at all. Got the other two running right now but looks like I'll be able to switch everything to Python 3 with no problem at all. Thank you for making it so easy!

1 Like

I followed the instructions but get this error

pi@octopi:~ sudo curl -L https://get.octoprint.org/upgrade.py --output upgrade.py % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 154 100 154 0 0 1062 0 --:--:-- --:--:-- --:--:-- 1062 100 39304 100 39304 0 0 92917 0 --:--:-- --:--:-- --:--:-- 92917 pi@octopi:~ sudo python3 upgrade.py
File "upgrade.py", line 1

<!DOCTYPE html>
^

SyntaxError: invalid syntax

Can anyone help?

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