Octoprint installation destroyed while upgrading to Python 3

What is the problem?

I tried to upgrade my OctoPi to Python 3 using the script I found here: GitHub - cp2004/Octoprint-Upgrade-To-Py3: A script to move an existing OctoPrint install from Python 2 to Python 3

Unfortunately, my Keyboard is connected to 2 computers with an USB switch and I sent Ctrl+C to the wrong machine - and cancelled the process while running...

The installation of Python 3 has been finished (And therefore the script refuses to run again) but the installation of Octoprint did not complete.
I attached a screenshot below showing the latest output of the script.

A Webserver seems to be running, as I get the " The OctoPrint server is currently not running" Page when opening Octoprint in my Browser, but thats all.

So now I somehow have to repeat the installation part of the script, if possible without loosing my Plugins and their configuration.
But I have no idea how to do so...
Is there any way to repair my installation?

What did you already try to solve it?

Start/Restart the service with sudo service octoprint (re)start - Command provides no output and does nothing
ps -ef | grep -i octoprint | grep -i python says grep: octoprint: No such file or directory

Have you tried running in safe mode?

Did not find out how to do so from the command line

Did running in safe mode solve the problem?

I guess not

Systeminfo Bundle

You can download this in OctoPrint's System Information dialog ... no bundle, no support!) -> Obviously I can't use the System information dialog! :wink:

Additional information about your setup

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

See screenshot:

If it helps I can add the octoprint.log, but as the latest entry is the goodbye from the server right before starting the upgrade, I don't thnik it will be useful.

The script stores a backup of the old environment as the first step before it can create a new one. So in our case here it should be quite easy to put the old one back, and then retry the script.

First, verify that oprint.bak exists - run ls from the home folder (or ls ~) and check it's there.

Then you can remove the partially created one - rm -rf ~/oprint.

Then put the old one back where it was before you ran the script - mv ~/oprint.bak ~/oprint.

Now if you reboot/run sudo service octoprint restart you should be back running, albeit on Py2. The upgrade script should then work again (hopefully not cancelled this time!).

1 Like

Oh, that was really quite easy... Embarrassing that I didn't figure this out myself :flushed:

Thanks a lot for your help Charlie!

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