question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No module named 'urllib3.packages.six'

See original GitHub issue
>>> import urllib3
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.6/site-packages/urllib3/__init__.py", line 8, in <module>
    from .connectionpool import (
  File "/usr/lib/python3.6/site-packages/urllib3/connectionpool.py", line 11, in <module>
    from .exceptions import (
  File "/usr/lib/python3.6/site-packages/urllib3/exceptions.py", line 2, in <module>
    from .packages.six.moves.http_client import (
ModuleNotFoundError: No module named 'urllib3.packages.six'
>>> 

I checked that I have already installed urllib3 and six.

$ python -m pip install --upgrade --user urllib3
Requirement already up-to-date: urllib3 in /usr/lib/python3.6/site-packages (1.24.1)
$ python -m pip install --upgrade --user six    
Requirement already up-to-date: six in ./.local/lib/python3.6/site-packages (1.12.0)

What am I missing?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

8reactions
robert-shadecommented, Jan 30, 2020

For future generations, since this is the first hit in Google: I just saw this same issue. Root cause for me was that CentOS was trying to “unbundle” six and replaces the file with a symlink (https://git.centos.org/rpms/python-urllib3/blob/c8/f/SPECS/python-urllib3.spec#_85). At some point six must have been uninstalled from the system by something other than dnf/yum, which broke the packaging. Reinstalling the six package un-breaks things.

1reaction
jackzhao12345commented, Mar 1, 2022

Lower version 1.24.1,Can solve this problem. It is estimated that your version is 1.26

Read more comments on GitHub >

github_iconTop Results From Across the Web

ModuleNotFoundError: No module named 'urllib3.packages.six'
I'm not able to run my airflow image. It builds successfully, but when I use docker-compose up and bring up the image, it...
Read more >
ModuleNotFoundError: No module named 'urllib3' in Python
The Python "ModuleNotFoundError: No module named 'urllib3'" occurs when we forget to install the urllib3 module before importing it or install it in...
Read more >
Fix Error – ImportError: No module named packages.urllib3 ...
Recently when I was creating Python automation script I faced this weird error. This literally wasted my couple of days and needless to ......
Read more >
No module named urllib3 | Edureka Community
The following is a script to call an API. But I am getting the following error message while running it: Traceback (most recent...
Read more >
Why yum/subscription-manager/sosreport fail on system with ...
Performing yum update results in the error No module named yum; While running ... Reinstall python package by running following command:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found