How can I update the OctoPrint installation on my OctoPi image?

OctoPrint on OctoPi will offer to update itself automatically via the bundled Software Update plugin when a new release is out.

If for whatever reason you need to manually update OctoPrint though, see the following steps.

:warning: Warning

Do not use sudo for the pip command below

If you need sudo in order to update your OctoPi, you broke something on your OctoPi installation (probably by using sudo accidentally earlier) and you need to fix your permissions, not just blindly put sudo in front of commands until stuff works.

  1. ~/oprint/bin/pip install -U octoprint
  2. sudo service octoprint restart

If you are tracking git commits instead of releases, you'll instead want to modify your checked out copy and install that:

cd ~/OctoPrint
source ~/oprint/bin/activate
git pull
python clean
pip install .
sudo service octoprint restart


I had some trouble with 1.3.7 upgrade through the web interface. It kept indicating it had completed, but it had actually failed. The error had to do with a dependency not being available, but the prompt to reload the page covered the message so I can't post it here. I followed the manual instructions for a latest install (not from source) and I've had two problems so far. I'm a pretty long-term linux user and python dabbler, so I'm trying to troubleshoot myself to give you all I can.

  1. pip did not like the SSL cert for the url. It looks like you may need to add the subject alternate name from the looks of it to me. I was able to get by this by simply passing the command to trust the cert like this: pip install --trusted-host install

  2. It did not like my perms on /usr/lib/python2.7/dist-packages.

Regarding number two, initially it complained that it couldn't created werkzeug directory under there, so I went ahead and added the pi account to the staff group since that had group ownership of the area. That also did not work, so I went ahead and created werkzeug directory in that location /usr/lib/python2.7/dist-packages and made sure staff group had permissions to that new directory.

I got further, but then it tossed an error that it couldn't create another new file: /usr/local/lib/python2.7/dist-packages/Werkzeug-0.8.3.egg-info. All my pi home directories are permed properly and it looks like root owns the install in /usr/local (which would make sense). At this point, I temporary opened perms to any valid account to that directory with a chmod -R ugo+rwx /usr/lib/python2.7 and tried again.

This got me a lot further, but then I ran into problems removing old files in the /usr/lib/python2.7 directory that appear to be root:root owned so I decided to chown the entire /usr/local/lib/python2.7 and /usr/lib/python2.7 folder to pi:pi and removed rwx permissions to other recursively from /usr/local/lib/python2.7/ that I had previously added. I don't use this machine for any other purpose so this is probably the safest method.

  1. Once I thought I had solved the permissions issue, I no longer could run the pip install command. It appeared to have lost my environment variables:
    "Consider setting $PYTHONHOME to [:<exec_prefix>]
    Traceback (most recent call last):
    File "./pip", line 5, in
    from pkg_resources import load_entry_point
    File "/home/pi/oprint/local/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/", line 17, in
    from urlparse import urlparse, urlunparse
    ImportError: No module named urlparse

Well since I don't know what the environment was before, I'm a little lost at this point. I'm going to go looking around a bit more and see if I can't get back the python environment and retry, but thought I'd share this latest experience in case it helps you or others!

Well - I think I see some of the root of this - the pip I was using was not the one in ~/oprint/bin but rather the environment pip - the oprint/bin version does not recognize the trusted-host argument, so that problem still remains as an outstanding issue to this article that you might want to provide some direction on.

I also found that some of what I thought I had changed ownership on still showed root owned. I fixed the perms to pi:pi again and reran the environmental pip (/usr/local/bin/pip vs the one in ~/oprint/bin) and that finally did allow the install to finish running as pi user however, I've confirmed that my web interface displays us still on 1.3.6 version which indicates to me that environmental pip is installing someplace other than the pi home dir and therefore the install is pretty much pointless.

Finally, I thought maybe you had left non-ssl as an option and went ahead and used ~oprint/bin/pip install and this worked (note http not https), so I think if you can just get either this article fixed or the ssl cert such that pip will trust it, that should do!

1 Like

Hm... pip accepts the https URL here just fine, otherwise I wouldn't have posted that up there. What pip version is that (pip --version)?

I can't seem to run that, well, I can type it in obviously, but when I press enter, it says this: (The output is bold)
bash: /home/liam/oprint/bin/pip: No such file or directory
By the way, I couldn't find any rpis online that weren't over 100 bucks, so I used an HP desktop and I booted it with Ubuntu, then followed this tutorial

That's the command for octopi images.

In your case it's probably

~/OctoPrint/venv/bin/pip install -U octoprint

You can also try

~/OctoPrint/venv/bin/pip install --force-reinstall OctoPrint==1.7.3 --no-cache-dir

Ok, that worked, thanks!

Wait, by "worked" I meant I could plug it into the terminal and saw output, but when I go to the OP UI, it still says 1.4.0 and wants to update. Is there a reboot required or something?

What OctoPi version do you use?

Octopi as in the RPi OS?

If so, I used an HP Desktop I booted with Ubuntu, couldn't find an RPi online under $100.

Either restart Octoprint or reboot the machine.

Did, no change.

In the tile you say OctoPi image...

Typo, I meant how do I update OP on Ubuntu

Edit, that wasn't me, that was foosel

Then you may had open a new thread...