Star Hype News.

Premium celebrity moments with standout appeal.

general

pip install error

By Sophia Bowman

18.04.2 pip install script as sudo was executed per instructions:

wget
sudo python3 get-pip.py
rm get-pip.py

and an error (in bold below) was observed however the final pip --version seems to work correctly.

Is there any reason to be concerned regarding the error? If so, what corrective action is needed?

user@nanite:/$ sudo python3 get-pip.py WARNING: The directory '/home/user/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. WARNING: The directory '/home/user/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. Collecting pip Downloading (1.4MB) |████████████████████████████████| 1.4MB 368kB/s Collecting setuptools Downloading (575kB) |████████████████████████████████| 583kB 11.3MB/s Collecting wheel Downloading

ERROR: launchpadlib 1.10.6 requires test resources, which is not installed.

Installing collected packages: pip, setuptools, wheel Successfully installed pip-19.1.1 setuptools-41.0.1 wheel-0.33.4 user@nanite:/$ pip --version pip 19.1.1 from /usr/local/lib/python3.6/dist-packages/pip (python 3.6)

1 Answer

You are installing pip with sudo but its using your user's home folder's python staging area. This can cause issues later on where paths added by the sudo'd process are not writable by non-sudo'd processes.

sudo -H ... will avoid those errors.

 -H, --set-home Request that the security policy set the HOME environment variable to the home directory specified by the target user's password database entry. Depending on the policy, this may be the default behavior.

Would it not be preferable to install pip3 via apt?

sudo apt install python3-pip -y && sudo -H pip3 install --upgrade pip

This way any dependencies are met in accordance with the 18.04.2 LTS release.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy