Note
This process will not impact any saved data or plugin installs, so it is harmless to give it a try if recommended.
There are some occasions where you want to reinstall OctoPrint - like if OctoPrint doesn't start anymore after a failed update or if you can't update OctoPrint to a newer version because something went wrong during the update.
Sometimes it also helps in situations where the filesystem was damaged (for example after a pulled plug, a power outage, a crash and similar events).
In those cases I would highly recommend to start OctoPrint just once, then backup everything you need via the backup assistant in the settings menu and to flash a fresh image and restore your backup.
You never know what besides of OctoPrint was damaged and the system might become unstable.
Reinstallation of OctoPrint running on OctoPi
To reinstall OctoPrint on OctoPi you open an ssh connection and copy/type the following into the command line, pressing Enter at the end:
~/oprint/bin/pip install --force-reinstall OctoPrint==X.Y.Z --no-cache-dir
Heads-up!
You have to replace the X.Y.Z with the version of OctoPrint you want to install - at the time of writing the latest version is 1.10.3, but in the future the version will change.
So for 1.10.3 it would be
~/oprint/bin/pip install --force-reinstall OctoPrint==1.10.3 --no-cache-dir
followed by pressing Enter.
Now the selected version of OctoPrint should reinstall.
When the installation has finished without an error you can start OctoPrint either with
sudo service octoprint restart
or by simply restarting the pi with sudo restart
.
Generic reinstallation
The above steps are OctoPi specific, but reinstallation can be done in generic setups:
- Stop OctoPrint
- Reinstall it:
Replace/path/to/pip install --force-reinstall OctoPrint==X.Y.Z --no-cache-dir
/path/to/pip
with thepip
binary in your OctoPrint's virtual environment andX.Y.Z
with the version of OctoPrint you want to reinstall, e.g.1.10.3
. - Restart OctoPrint
If reinstallion doesn't help
If reinstallation alone doesn't help and the above commands only give you errors, it might be that your virtual environment has become corrupted.
You might be able to get things going again by recreating it. octoprint-venv-tool
can help with this, see