Search code examples
pythonpip

pip installation rendered useless after installation of pysftp


I was trying to install pysftp using the command

pip3 install pysftp==0.2.9

But during the installation I got errors saying an uninstallation was unsuccesful

suddenly upon restarting python project, my complete pip seems to be destroyed. No matter what I do, event the pip --help command is enough and I will get this error

File "/usr/lib/python3/dist-packages/OpenSSL/crypto.py", line 1573, in X509StoreFlags
CB_ISSUER_CHECK = _lib.X509_V_FLAG_CB_ISSUER_CHECK
AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'

here is the entire stack trace https://pastebin.com/b3v50QuM

I have tried to use the workaround from AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'

But that just leads to more errors down the line,

I was trying to upgrade the module but every pip commands outputs that error.

I can not perform an upgrade or any pip command as any pip command just outputs the error

if fixing it is not possible, how can I reinstall the python package manager or reset it?

I have already tried reinstalling pip via apt, which worked but after the reinstallation I the error still persisted


Solution

  • The Following steps solved the issue:

    1. navigate to the folder of your python installation
    2. navigate into the dist-packages folder
    3. force delete the OpenSSL Folder
    4. the pip command should now work again, install pyOpenSSL on the correct version