How to fix Error: "module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'" when calling pip

How to fix Error: "module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'" when calling pip

Problem Description:

On my WSL im getting the error AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK' whenever I try to use pip e.g. pip list, python3 -m pip, etc.

Is there a way to reinstall pip or uninstall packages without using pip? I tried following the solutions in related Questions but none of them work because they either use pip or the problem persists after.

Solution – 1

The solution that worked for me was mentioned here
you have to remove the line

CB_ISSUER_CHECK = _lib.X509_V_FLAG_CB_ISSUER_CHECK

from file

/usr/lib/python3/dist-packages/OpenSSL/crypto.py

and then you can use pip again

    pip uninstall cryptography
    pip install --upgrade cryptography==36.0.2
Rate this post
We use cookies in order to give you the best possible experience on our website. By continuing to use this site, you agree to our use of cookies.
Accept
Reject