Any way to install Paramiko manually

Hello, All

While I was running my playbook, I keep getting Paramiko error, so I’m currently trying to install Paramiko. Looks like some SSL connection related issues are happening. Any one have any clues? Or any way to install Paramiko manually?

[root@ansible002 ~]# pip install paramiko
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1129)'))': /simple/paramiko/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1129)'))': /simple/paramiko/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1129)'))': /simple/paramiko/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1129)'))': /simple/paramiko/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1129)'))': /simple/paramiko/
Could not fetch URL https://pypi.org/simple/paramiko/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/paramiko/ (Caused by SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1129)'))) - skipping
ERROR: Could not find a version that satisfies the requirement paramiko (from versions: none)
ERROR: No matching distribution found for paramiko
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1129)'))) - skipping
[root@ansible002 ~]#

Thank you for reading, and highly appreciated in case of any input.

Hello @bacchus21,

This error is quite explicit:

So to start with, I’d try this solution on SO:

Let’s see if that helps you.

Cheers!

2 Likes

Hello, @jbericat
Thank you for looking at my topic.

Actually, I tried the ways the same as your suggestion. But, the issues are still there unforunately.

[user1@ansible002 ~]$ python -m pip install --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org --upgrade pip Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pip in /usr/lib/python3.9/site-packages (21.2.3)
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1129)'))': /simple/pip/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1129)'))': /simple/pip/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1129)'))': /simple/pip/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1129)'))': /simple/pip/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1129)'))': /simple/pip/
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1129)'))) - skipping
WARNING: Value for scheme.platlib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
distutils: /home/user1/.local/lib/python3.9/site-packages
sysconfig: /home/user1/.local/lib64/python3.9/site-packages
WARNING: Additional context:
user = True
home = None
root = None
prefix = None
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1129)'))) - skipping
[user1@ansible002 ~]$

[user1@ansible002 ~]$ python -m pip install Paramiko --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org
Defaulting to user installation because normal site-packages is not writeable
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1129)'))': /simple/paramiko/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1129)'))': /simple/paramiko/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1129)'))': /simple/paramiko/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1129)'))': /simple/paramiko/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1129)'))': /simple/paramiko/
Could not fetch URL https://pypi.org/simple/paramiko/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/paramiko/ (Caused by SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1129)'))) - skipping
ERROR: Could not find a version that satisfies the requirement Paramiko (from versions: none)
ERROR: No matching distribution found for Paramiko
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1129)'))) - skipping
[user1@ansible002 ~]$

Hey @bacchus21 now I remember you! We have been trying to workaround something similar the last week. On my mind, the root issue is the same you had before (remember that we applied a workaround to install a collection, but we actually didn’t fix the root cause):

Let’s get back to the point where you were unable to execute update-ca-certificates. I remember that you couldn’t do it because the command wasn’t available.

So, try installing the package first. On RHEL9 you can do it this way:

sudo dnf install ca-certificates

After that, you should be able to execute these commands:

sudo update-ca-certificates --fresh
export SSL_CERT_DIR=/etc/ssl/certs

Be aware that if you do not install the package first you will get the command not found error!

PS: Check-out this link also, it has related info:

1 Like

Hello, @jbericat

Thank you very much for your advice. I tried as advised.

[root@ansible002 ~]# dnf install ca-certificates
Updating Subscription Management repositories.
Last metadata expiration check: 0:48:34 ago on Tue 21 Nov 2023 09:43:40 AM UTC.
Package ca-certificates-2023.2.60_v7.0.306-90.1.el9_2.noarch is already installed. Dependencies resolved.
Nothing to do.
Complete!
[root@ansible002 ~]#
[root@ansible002 ~]# update-ca-certificates --fresh
-bash: update-ca-certificates: command not found
[root@ansible002 ~]#

Unfortunately, update-ca-certificates --fresh is not working yet.

Regards

1 Like

Sorry for the confusion, I’m so very used to Debian distros… It looks like that in RHEL the appropriate command would be update-ca-trust instead

@jbericat Thank you again. I tried it already though :grinning: But it didn’t go well as expected.

[root@vmc3ansible002 ~]# dnf install ca-certificates
Updating Subscription Management repositories.
Last metadata expiration check: 2:14:22 ago on Tue 21 Nov 2023 09:43:40 AM UTC.
Package ca-certificates-2023.2.60_v7.0.306-90.1.el9_2.noarch is already installed.
Dependencies resolved.
Nothing to do.
Complete!
[root@vmc3ansible002 ~]# update-ca-trust
[root@vmc3ansible002 ~]# export SSL_CERT_DIR=/etc/ssl/certs
[root@vmc3ansible002 ~]#
[root@vmc3ansible002 ~]# pip install Paramiko
Requirement already satisfied: Paramiko in /usr/local/lib/python3.9/site-packages (3.3.1)
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1129)'))': /simple/pynacl/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1129)'))': /simple/pynacl/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1129)'))': /simple/pynacl/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1129)'))': /simple/pynacl/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1129)'))': /simple/pynacl/
Could not fetch URL https://pypi.org/simple/pynacl/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pynacl/ (Caused by SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1129)'))) - skipping
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1129)'))': /simple/paramiko/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1129)'))': /simple/paramiko/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1129)'))': /simple/paramiko/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1129)'))': /simple/paramiko/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1129)'))': /simple/paramiko/
Could not fetch URL https://pypi.org/simple/paramiko/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/paramiko/ (Caused by SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1129)'))) - skipping
ERROR: Could not find a version that satisfies the requirement pynacl>=1.5 (from paramiko) (from versions: none)
ERROR: No matching distribution found for pynacl>=1.5
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1129)'))) - skipping
[root@vmc3ansible002 ~]#

Okay that’s one of these problems that are hard to workaround, but let’s keep insisting. That’s what I’d do:

1. Update CA certificates manually (again, but this time we’re gonna reinstall them):

dnf reinstall ca-certificates
update-ca-trust

2. re-set SSL/TLS env vars:

export SSL_CERT_DIR=/etc/ssl/certs
export SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt

3. Check system time and date:

SSL/TLS connections can fail if the system time is different from the current time. So let’s chech that also

4. Network issues

If the issue persists after trying these steps, it might indicate a deeper issue with SSL/TLS configuration or network connectivity problems. You may use a different VM or machine connected to the same network with a fresh RHEL installation, see how does it behave…

I’ll keep thinking to see if I get any more ideas. We could also call for the chivalry, but let’s use all the bullets before doing so

regards!

Hello, @jbericat

Thank you very much for looking at this issue. One question is that I wonder if there are any ways to install manually using paramiko-3.3.1.tar.gz, which I downloaded from paramiko · PyPI

Regards

Hello @bacchus21 I hope you’re doing well. Of course there is a way. For example:

pip install --user ./Downloads/PyGUI-2.5.4.tar.gz

This will install the package PyGUI manually using the downloaded tar.gz (just adapt the example to your use case). Anyway I doubt this will fix your issue permanently. But if you’re in a hurry, this may save the day for the time being… Until you hit the SSL issue again

Regards

1 Like

Hello, @jbericat

Thank you very much for your feedback. I’ve already tried to install via your suggested method, but still with the SSL error. Instead, I tried to install the package via our internal repo(like by using proxy). Finally it worked out!!!

[root@ansible002 .pip]$ pip show paramiko
Name: paramiko
Version: 3.3.1
Summary: SSH2 protocol library
Home-page: https://paramiko.org
Author: Jeff Forcier
Author-email: jeff@bitprophet.org
License: LGPL
Location: /usr/local/lib/python3.9/site-packages
Requires: pynacl, cryptography, bcrypt
Required-by:
[root@ansible002 .pip]$

Therefore, I guess this is caused by some network issues. Thank you very much for helping me. Highly appreciated.

1 Like

Hello @bacchus21 I’m very glad to read that, really. As I said before, these SSL errors sometimes are quite difficult to workaround (I’ve been there a couple of times myself).

May I ask you to tick the solved check on the post you believe it helped the most? Just for housekeeping sake, so this thread appears as solved on the get-help section.

Regards and have a nice weekend ahead!

Hello, @jbericat

As I said before, these SSL errors sometimes are quite difficult to workaround (I’ve >been there a couple of times myself).
Yes, I totally agree. It’s more likely the issues from system environment than actual patamiko issue.

Thank you very much for your support and help! Have a nice weekend.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.