Pip version issues [possibly solved, it's not acting as a problem at the moment]


#1

What is the problem?
OctoPrint/OctoPi Software Updater dialog reports that I'm running pip version 8.1.1 and as a result I"m running an out of date python instance.
Running 'pip --version' in /home/pi/octoprint/bin/ returns the following (after attempts to update):

pi@powerspec2:~/oprint/bin $ ./pip --version
pip 18.1 from /home/pi/oprint/local/lib/python2.7/site-packages/pip (python 2.7)
pi@powerspec2:~/oprint/bin $

What did you already try to solve it?
Followed the instructions on the OctoPi for updating pip using the commands:

source ~/oprint/bin/activate
pip install --upgrade pip

Also have run
sudo service octoprint restart
several times, and observed that the server/service has restarted as the web interface becomes unavailable and restores.

When looking at the Software Update dialog I continue to get the following output:


**This version of the Python environment is not supported for direct updates.**

To reduce the likelihood of running into update problems in outdated environments, the following minimal versions are required to use this updater to update OctoPrint or any installed plugins:

* Python: 2.7.9 (you have: 2.7.9)
* pip: 9.0.1 (you have: 8.1.1)
* setuptools: 5.5.1 (you have: 5.5.1)

This is different from what the octoprint.log shows, where I see the following:

2019-01-07 18:10:45,942 - octoprint.environment - INFO - Detected environment is Python 2.7.9 under Linux (linux2). Details:
|  hardware:
|    cores: 4
|    freq: 1200.0
|    ram: 904245248
|  os:
|    id: linux
|    platform: linux2
|  plugins:
|    pi_support:
|      model: Raspberry Pi 3 Model B Rev 1.2
|      octopi_version: 0.13.0
|  python:
|    pip: 8.1.1
|    version: 2.7.9
|    virtualenv: /home/pi/oprint

My presumption is that the output on the Software Update page is actually preventing automatic updates from happening, even though it appears that the server recognises the new version of pip. This is consistent with plugins showing different versions between what is installed and what is available at this time.

Love the platform, and thank you for all the great work.

Additional information about your setup (OctoPrint version, OctoPi version, printer, firmware, octoprint.log, serial.log or output on terminal tab, ...)
OctoPrint version: 1.3.10
OctoPi version: 0.13.0, running on Raspberry Pi 3 Model B Rev 1.2
Printer on this instance is a Wanhao Duplicator I3 Plus running the Powerspec release (Microcenter branded stock Wanhao firmware so far as I can tell) {I don't think that it's critical for this issue, serial.log is not currently enabled and I strongly doubt that this is related to printer communications}

I've 'trimmed' the octoprint.log file by stripping out the log entries that are various plugins and the server heartbeat messages using the following script:

grep -v server.heartbeat octoprint.log |\
 grep -v plugins.tracking |\
 grep -v plugins.navbartemp |\
 grep -v SlicerSettingsParser |\
 grep -v forcelogin |\
 grep -v tornado.access \
  > octoprint.trimmed.log

If any of these are needed, let me know. This knocked knocked the file down to under 700 lines.

which still includes too many characters here, so posted to pastebin.com at octoprint.trimmed.log


Pip version warning after successful plugin installation
#2

your python path doesn't by default use octoprint's python.
try the following:
cd ~/oprint/bin
./pip install --upgrade pip

Otherwise, you are trying to upgrade raspbians default python pip, from /usr/lib/python (I think)
This worked for me.


#3

Nope, @rusty did in fact activate the venv, so that's fine. However, something still doesn't add up here or it would report 18.1 and not 8.1.1.

@rusty, what does /home/pi/oprint/bin/python -m pip --version produce?


#4

Appologies for the delay, I work nights and just finished getting everything ready to head to bed when I saw the request.

pi@powerspec2:~ $ /home/pi/oprint/bin/python -m pip --version
pip 18.1 from /home/pi/oprint/local/lib/python2.7/site-packages/pip (python 2.7)
pi@powerspec2:~ $ 

Note that I had just made the decision to do something that I hadn't up until this morning, which was to reload the entire platform. When the UI came back, it offered to do direct updates to plugins that had outstanding updates. Once that is done I'll take another look, but I'm willing to bet that the warning message is not being displayed any more.

I had restarted the OctoPrint services several times (as seen in the octoprint.log file) however I had not done a soft reset of the entire raspberry Pi. So my guess is that something was hanging in raspbian somewhere that OctoPrint was hanging onto in the webui, that cleared during a reboot.

I was hoping that I could find out what was the issue by checking the OctoPi instnace on the server running at powerspec.local rather than powerspec2.local which the above all relates to, but when I looked at that instance this morning it shows no warning, I reloaded the box anyway, and it found the same two pluins to update which I gave it approval to do. So I probably should have checked the Powerspec2.local instance before reloading it this morning.

In any case, it appears that the problem did get resolved one way or another.

Ok, ran that command on powerspec.local and this is the output it gives me:

pi@powerspec2:~ $ /home/pi/oprint/bin/python -m pip --version
pip 18.1 from /home/pi/oprint/local/lib/python2.7/site-packages/pip (python 2.7)
pi@powerspec2:~ $ 

So it hasn't gotten the 18.1 version, but somewhere along the line did get the 9.0.1 version. I'm not going to complain, but I'll leave it alone at this point.

Possibly a note in the instructions that the OctoPi instance may benefit from a 'reboot system' if you get the 18.1 version at the command line, and you find it in the octoprint.log file, but the web ui continues to report that the installed version is at 8.0.1

In retrospect, another thing that I didn't do was a hard reload of the web browser. I do not know enough about the interaction between Chrome and the OctoPrint web server to know if there is something in there that ages out the content, and the web browser may have been caching dialogs. Perhaps all I needed to do was a reload from source command to Chrome, or kick off Firefox to the same page to get the right content. In any case it appears to be working now.

Thank you for the work you're doing. With at least four OctoPrint instances, 2 live at the moment, I can say that it works very well. Minor hick-ups aside.


#5

I see after posting that I pasted in the same content twice. The second one should be:

pi@powerspec:~ $ /home/pi/oprint/bin/python -m pip --version
pip 9.0.1 from /home/pi/oprint/local/lib/python2.7/site-packages (python 2.7)
pi@powerspec:~ $