Pip tips and tricks: Difference between revisions

From HPCWIKI
Jump to navigation Jump to search
No edit summary
No edit summary
Line 2: Line 2:
== ERROR: Could not install packages due to an OSError: Errno 1 Operation not permitted ==
== 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">
'''The "OSError: [Error 1] Operation not permitted" error is often caused by having incompatible versions of packages on system.''' <syntaxhighlight lang="bash">
#mostly by six, triton package, filelock to solve this issue
# reinstall the problem package with update version


pip install --ignore-installed six triton filelock
pip install --ignore-installed --upgrade <packages>
</syntaxhighlight>
</syntaxhighlight>



Revision as of 16:45, 11 March 2024

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[1]

#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

References