Pip tips and tricks: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
== Install latest pip<ref>https://robots.uc3m.es/installation-guides/install-pip.html</ref> == | |||
Install latest pip at the first time on the system | |||
<code>wget <nowiki>https://bootstrap.pypa.io/get-pip.py</nowiki> | sudo python</code> | |||
== No module named 'distutils.cmd' == | |||
Need to install Python distutils and apt | |||
sudo apt-get install python3-distutils python3-apt | |||
== ERROR: Could not install packages due to an OSError: Errno 1 Operation not permitted == | |||
'''The "OSError: [Error 1] Operation not permitted" error is often caused by having incompatible versions of packages on system.''' <syntaxhighlight lang="bash"> | |||
# reinstall the problem package with update version | |||
pip install --ignore-installed --upgrade <packages> | |||
</syntaxhighlight> | |||
== module 'lib' has no attribute 'X509_V_FLAG_NOTIFY_POLICY == | == module 'lib' has no attribute 'X509_V_FLAG_NOTIFY_POLICY == |
Latest revision as of 13:54, 25 May 2024
Install latest pip[1]
Install latest pip at the first time on the system
wget https://bootstrap.pypa.io/get-pip.py | sudo python
No module named 'distutils.cmd'
Need to install Python distutils and apt
sudo apt-get install python3-distutils python3-apt
ERROR: Could not install packages due to an OSError: Errno 1 Operation not permitted
The "OSError: [Error 1] Operation not permitted" error is often caused by having incompatible versions of packages on system.
# reinstall the problem package with update version
pip install --ignore-installed --upgrade <packages>
module 'lib' has no attribute 'X509_V_FLAG_NOTIFY_POLICY
# Remove installed OpenSSL lib package
$sudo rm -rf /usr/lib/python3/dist-packages/OpenSSL
# Reinstall updated pyopenssl
$sudo -H pip3 install -U pyopenssl
WARNING: Running pip as the 'root' user
This was introduced in pip 21.1
as a "bug fix" as of pip 22.1[2]
#you can now opt out of the warning using a parameter:
$sudo pip install --root-user-action=ignore <packages>
# You can ignore this in your container by using the environment:
ENV PIP_ROOT_USER_ACTION=ignore