Unable to install any python3 modules using pip command

Hi,
It seems like python3.7.3 in Tumbleweed can’t download modules from pypi.org; It was working great about month ago.

here’s my error message :


x-periment-thumbleweed-1:/ # pip3 --verbose install paho-mqtt
Created temporary directory: /tmp/pip-ephem-wheel-cache-vxl59ank
Created temporary directory: /tmp/pip-req-tracker-lmls0huq
Created requirements tracker '/tmp/pip-req-tracker-lmls0huq'
Created temporary directory: /tmp/pip-install-p44_8prj
Collecting paho-mqtt
  1 location(s) to search for versions of paho-mqtt:
  * https://pypi.org/simple/paho-mqtt/
  Getting page https://pypi.org/simple/paho-mqtt/
  Found index url https://pypi.org/simple
  Looking up "https://pypi.org/simple/paho-mqtt/" in the cache
  Request header has "max_age" as 0, cache bypassed
  Starting new HTTPS connection (1): pypi.org:443
  Incremented Retry for (url='/simple/paho-mqtt/'): Retry(total=4, connect=None, read=None, redirect=None, status=None)
  WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by'SSLError(SSLError(336236609, '[SSL] malloc failure (_ssl.c:2994)'))': /simple/paho-mqtt/
  Starting new HTTPS connection (2): pypi.org:443
  Incremented Retry for (url='/simple/paho-mqtt/'): Retry(total=3, connect=None, read=None, redirect=None, status=None)
  WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by'SSLError(SSLError(336236609, '[SSL] malloc failure (_ssl.c:2994)'))': /simple/paho-mqtt/
  Starting new HTTPS connection (3): pypi.org:443
  Incremented Retry for (url='/simple/paho-mqtt/'): Retry(total=2, connect=None, read=None, redirect=None, status=None)
  WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by'SSLError(SSLError(336236609, '[SSL] malloc failure (_ssl.c:2994)'))': /simple/paho-mqtt/
  Starting new HTTPS connection (4): pypi.org:443
  Incremented Retry for (url='/simple/paho-mqtt/'): Retry(total=1, connect=None, read=None, redirect=None, status=None)
  WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by'SSLError(SSLError(336236609, '[SSL] malloc failure (_ssl.c:2994)'))': /simple/paho-mqtt/
  Starting new HTTPS connection (5): pypi.org:443
  Incremented Retry for (url='/simple/paho-mqtt/'): Retry(total=0, connect=None, read=None, redirect=None, status=None)
  WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by'SSLError(SSLError(336236609, '[SSL] malloc failure (_ssl.c:2994)'))': /simple/paho-mqtt/
  Starting new HTTPS connection (6): pypi.org:443
  Could not fetch URL https://pypi.org/simple/paho-mqtt/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/paho-mqtt/ (Caused by SSLError(SSLError(336236609, '[SSL] malloc failure (_ssl.c:2994)'))) - skipping
  ERROR: Could not find a version that satisfies the requirement paho-mqtt (from versions: none)
Cleaning up...
Removed build tracker '/tmp/pip-req-tracker-lmls0huq'
ERROR: No matching distribution found for paho-mqtt
Exception information:
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 193, in main
    status = self.run(options, args)
  File "/usr/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 352, in run
    resolver.resolve(requirement_set)
  File "/usr/lib/python3.7/site-packages/pip/_internal/resolve.py", line 132, in resolve
    self._resolve_one(requirement_set, req)
  File "/usr/lib/python3.7/site-packages/pip/_internal/resolve.py", line 295, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/usr/lib/python3.7/site-packages/pip/_internal/resolve.py", line 243, in _get_abstract_dist_for
    self.require_hashes
  File "/usr/lib/python3.7/site-packages/pip/_internal/operations/prepare.py", line 282, in prepare_linked_requirement
    req.populate_link(finder, upgrade_allowed, require_hashes)
  File "/usr/lib/python3.7/site-packages/pip/_internal/req/req_install.py", line 198, in populate_link
    self.link = finder.find_requirement(self, upgrade)
  File "/usr/lib/python3.7/site-packages/pip/_internal/index.py", line 899, in find_requirement
    'No matching distribution found for %s' % req
pip._internal.exceptions.DistributionNotFound: No matching distribution found for paho-mqtt
1 location(s) to search for versions of pip:
* https://pypi.org/simple/pip/
Getting page https://pypi.org/simple/pip/
Found index url https://pypi.org/simple
Looking up "https://pypi.org/simple/pip/" in the cache
Request header has "max_age" as 0, cache bypassed
Starting new HTTPS connection (1): pypi.org:443
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(SSLError(336236609,'[SSL] malloc failure (_ssl.c:2994)'))) - skipping

here’s python version :


x-periment-thumbleweed-1:/ # rpm -qa|grep python3
python3-3.7.3-1.1.x86_64
python3-pyparsing-2.4.0-1.3.noarch
python3-packaging-19.0-1.3.noarch
python3-pip-19.1.1+git.1557777841.63878672-1.3.noarch
patterns-devel-python-devel_python3-20180125-3.4.x86_64
libpython3_7m1_0-3.7.3-1.2.x86_64
python3-base-3.7.3-1.2.x86_64
python3-six-1.12.0-3.1.noarch
python3-appdirs-1.4.3-4.4.noarch
python3-setuptools-41.0.1-1.3.noarch
python3-devel-3.7.3-1.2.x86_64

I did try to add --trusted-host option but not working as expected.
I would appreciate any help.
Thanks!

Looks like the issue is with the SSL Certificate on Pypi.org.

The error message “There was a problem confirming the ssl certificate:” indicates the same. Please try to do the same after a few hours. it’ll work most probably. Otherwise, you can use the VPN to connect to the PyPi servers to download the modules and see if the issue arises or not.

I had same problem. I did try many thing such like --trusted-hosts, install more recent openssl, but nothing works.
and I found this link; It solved the problem.

If you’re referring to the part about updating pip and pip3 from PyPi,
I think that ha always been a soft requirement for as long as I can remember… The version from OSS will usually work, but it’s not guaranteed to do so or do so well.

Bottom line, if you’ve never installed from PyPi before or haven’t for a very long time, the first thing you should do is update your pip and pip3.

The other part in the thread about installing PyPi packages into a User directory can be recommended, but shouldn’t ordinarily be a must-do requirement. I suppose whether you do this is partly whether you intend to simply run python apps or intend to build apps… Running pre-built apps is usually a normal, User level function, but running system level apps and writing code is normally reserved for elevated permissions.

TSU