Tiny Core Linux

Tiny Core Base => Raspberry Pi => Topic started by: gatorback on February 26, 2020, 04:18:16 PM

Title: persistent pip troubleshooting
Post by: gatorback on February 26, 2020, 04:18:16 PM
"PERSISTENT PIP" was installed per SergiSM's procedure (https://github.com/SergiSM/Raspberry/wiki/piCore):

Code: [Select]
wget https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py

vi /opt/.filetool.lst
/usr/local/bin/pip
/usr/local/bin/pip-2.7
/usr/local/lib/python2.7/site-packages/pip-9.0.1.dist-info
/usr/local/lib/python2.7/site-packages/serial

filetool.sh -b

The device was able to install the 'requests' python library.   The rPi-ZW was rebooted and pip testing failed:

Code: [Select]
tc@box:~$ sudo -H pip install requests
Traceback (most recent call last):
  File "/usr/local/bin/pip", line 5, in <module>
    from pip._internal.cli.main import main
ModuleNotFoundError: No module named 'pip._internal'

What is the next step for diagnostic / corrective action?  Any insight (explanation) why pip fails after reboot is appreciated.

    [EDIT]: Added code tags.  Rich
Title: Re: persistent pip troubleshooting
Post by: Rich on February 26, 2020, 04:53:42 PM
Hi gatorback
Please use  Code Tags  when posting commands and responses seen in a terminal. To use  Code Tags  click on the  #  icon
above the reply box and paste your text between the  Code Tags  as shown in this example:

Quote
[code][   36.176529] pcm512x 1-004d: Failed to get supply 'AVDD': -517
[   36.176536] pcm512x 1-004d: Failed to get supplies: -517
[   36.191753] pcm512x 1-004d: Failed to get supply 'AVDD': -517[/code]

It will appear like this in your post:
Code: [Select]
[   36.176529] pcm512x 1-004d: Failed to get supply 'AVDD': -517
[   36.176536] pcm512x 1-004d: Failed to get supplies: -517
[   36.191753] pcm512x 1-004d: Failed to get supply 'AVDD': -517

Code Tags  serve as visual markers between what you are trying to say and the information you are posting. They also preserve
spacing so column aligned data displays properly.
Title: Re: persistent pip troubleshooting
Post by: gatorback on February 26, 2020, 05:25:49 PM
To ensure pip persistence between reboots: /usr/local/bin/pip was added to the file: /opt/.filetool.lst and saved with filetool.sh -b

After reboot, tests reveal that

Code: [Select]
sudo -H pip install requests
will install correctly ONLY IF:

Code: [Select]
sudo -H python /home/tc/pipPersistent/get-pip.py
executed prior: a failure of pip persistence.  It seems that pip is somehow not completely 'saved' and a reboot loses some pip install information.  What additional steps must be taken to ensure pip is persistent after reboots?   
Title: Re: persistent pip troubleshooting
Post by: Rich on February 26, 2020, 08:28:12 PM
Hi gatorback
I don't use Python myself, but I think  pip  is part of the Python package:
http://forum.tinycorelinux.net/index.php/topic,23500.0.html
Title: Re: persistent pip troubleshooting
Post by: gatorback on February 26, 2020, 09:20:34 PM
Thanks for the link.  pip's  new directories were identified and added to filetool.lst to successfully ensure persistence

pip's new directories have today's date / time after installing pip:

Code: [Select]
$ sudo -H python /home/tc/pipPersistent/get-pip.py
New pip directories are in:

Code: [Select]
$ sudo ls -l /usr/local/lib/python2.7/site-packages/
The new directories were added via:
Code: [Select]
$ vi /opt/.filetool.lst
/usr/local/lib/python2.7/site-packages/pip                      # required for pip persistence https://github.com/SergiSM/R
/usr/local/lib/python2.7/site-packages/pip-20.0.2.dist-info     # required for pip persistence
/usr/local/lib/python2.7/site-packages/wheel                    # required for pip persistence
/usr/local/lib/python2.7/site-packages/wheel-0.34.2.dist-info   # required for pip persistence

Persistence was verified by: rebooting and

Code: [Select]
$ sudo -H pip install requests
$ python import
>>> import requests