# SLES 12 SP5 mismatch in python modules python3-requests vs. python3-urllib3

**URL:** <https://forums.suse.com/t/sles-12-sp5-mismatch-in-python-modules-python3-requests-vs-python3-urllib3/35649>\
**Category:** SUSE Linux Enterprise Server\
**Created:** [July 1, 2021, 5:46pm UTC](https://forums.suse.com/t/sles-12-sp5-mismatch-in-python-modules-python3-requests-vs-python3-urllib3/35649 "2021-07-01T17:46:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brian\_Reichert](https://avatars.discourse-cdn.com/v4/letter/b/dec6dc/32.png) [@Brian\_Reichert](https://forums.suse.com/u/Brian_Reichert)\
**Post date:** [July 1, 2021, 5:46pm UTC](https://forums.suse.com/t/sles-12-sp5-mismatch-in-python-modules-python3-requests-vs-python3-urllib3/35649/1 "2021-07-01T17:46:33Z")

</div>

These details were described here; but I’ll try to recap:  
[https://bugzilla.suse.com/show\_bug.cgi?id=1187070](https://bugzilla.suse.com/show_bug.cgi?id=1187070 "https://bugzilla.suse.com/show\_bug.cgi?id=1187070")  
I’m trying to run a python3 program that cannot find a python module that is installed via an RPM:

```
10-153-30-11:~ # /usr/bin/cloud-init init |& tail -1
pkg_resources.DistributionNotFound: The 'requests' distribution was not found and is required by cloud-init

```

The set of packages are a consequence of SLES’s own dependencies, and are from their own repositories; cloud-init uses 3.4, which requires ‘python3-requests’, which in turn requires python 3.6:

10-153-30-11:~ # head -1 /usr/bin/cloud-init  
#!/usr/bin/python3  
10-153-30-11:~ # ls -ld /usr/bin/python3  
lrwxrwxrwx 1 root root 9 May 11 16:30 /usr/bin/python3 → python3.4

10-153-30-11:~ # rpm -qf /usr/bin/cloud-init  
cloud-init-20.2-37.50.8.x86\_64  
10-153-30-11:~ # rpm -q --requires cloud-init | grep requests  
python3-requests

10-153-30-11:~ # rpm -ql python3-requests | egrep ‘requests$’  
/usr/lib/python3.6/site-packages/requests  
/usr/share/doc/packages/python3-requests  
/usr/share/licenses/python3-requests

10-153-30-11:~ # rpm -q --requires python3-requests | head -2  
ca-certificates  
python(abi) = 3.6

```
10-153-30-11:~ # rpm -q python3-requests
python3-requests-2.25.1-4.1.noarch

```

It turns out that this SLES 12 SP5 box has two versions of python 3 installed:

```
10-153-30-11:~ # rpm -qa | egrep -e 'python3.*-base'
python36-base-3.6.13-4.36.1.x86_64
python3-base-3.4.10-25.66.1.x86_64

```

I can repro the cloud-init directly:

```
10-153-30-11:~ # python3.4 -c 'import requests;'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named 'requests'

```

Looks like python3-requests really needs python3.6:

```
10-153-30-11:~ # rpm -ql python3-requests-2.25.1-4.1.noarch | egrep 'requests$'
/usr/lib/python3.6/site-packages/requests
/usr/share/doc/packages/python3-requests
/usr/share/licenses/python3-requests

```

If I try my repro with 3.6, I get a different error:

Slightly different error:

```
10-153-30-11:~ # python3.6 -c 'import requests;'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.6/site-packages/requests/ __init__.py", line 43, in <module>
	import urllib3
ModuleNotFoundError: No module named 'urllib3'

```

But, that’s installed for 3.4:

```
10-153-30-11:~ # rpm -ql python3-urllib3-1.22-3.23.1.noarch | grep 'urllib3$'
/usr/lib/python3.4/site-packages/urllib3
/usr/share/doc/packages/python3-urllib3

```

So, neither python 3.4 or 3.6 can use the ‘requests’ module, as SLES’s supplied RPMs for ‘python3’ are really built for different versions of python 3.

How should I resolve this?

---

<div class="post-metadata">

**Author:** ![Brian\_Reichert](https://avatars.discourse-cdn.com/v4/letter/b/dec6dc/32.png) [@Brian\_Reichert](https://forums.suse.com/u/Brian_Reichert)\
**Post date:** [July 6, 2021, 2:34pm UTC](https://forums.suse.com/t/sles-12-sp5-mismatch-in-python-modules-python3-requests-vs-python3-urllib3/35649/2 "2021-07-06T14:34:41Z")

</div>

I can not repro this; is of this morning, SLES’s repos provide packages only for python 3.4, so the reported mismatch doesn’t occur.
