-1

I just installed urllib3 using pip command and was successful, and when i use import urllib3 or import urllib its showing a huge error. Why this happening?. Please help.

This is my error: when use import urllib or import urllib3 and running in sublime text.

Traceback (most recent call last):
  File "C:\Users\Toshiba\Desktop\dd.py", line 1, in <module>
    import urllib3
  File "C:\Users\Toshiba\AppData\Local\Programs\Python\Python38-32\lib\site-packages\urllib3\__init__.py", line 7, in <module>
    from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url
  File "C:\Users\Toshiba\AppData\Local\Programs\Python\Python38-32\lib\site-packages\urllib3\connectionpool.py", line 11, in <module>
    from .exceptions import (
  File "C:\Users\Toshiba\AppData\Local\Programs\Python\Python38-32\lib\site-packages\urllib3\exceptions.py", line 2, in <module>
    from .packages.six.moves.http_client import IncompleteRead as httplib_IncompleteRead
  File "C:\Users\Toshiba\AppData\Local\Programs\Python\Python38-32\lib\site-packages\urllib3\packages\six.py", line 199, in load_module
    mod = mod._resolve()
  File "C:\Users\Toshiba\AppData\Local\Programs\Python\Python38-32\lib\site-packages\urllib3\packages\six.py", line 113, in _resolve
    return _import_module(self.mod)
  File "C:\Users\Toshiba\AppData\Local\Programs\Python\Python38-32\lib\site-packages\urllib3\packages\six.py", line 82, in _import_module
    __import__(name)
  File "C:\Users\Toshiba\AppData\Local\Programs\Python\Python38-32\lib\http\client.py", line 71, in <module>
    import email.parser
  File "C:\Users\Toshiba\AppData\Local\Programs\Python\Python38-32\lib\email\parser.py", line 12, in <module>
    from email.feedparser import FeedParser, BytesFeedParser
  File "C:\Users\Toshiba\AppData\Local\Programs\Python\Python38-32\lib\email\feedparser.py", line 27, in <module>
    from email._policybase import compat32
  File "C:\Users\Toshiba\AppData\Local\Programs\Python\Python38-32\lib\email\_policybase.py", line 9, in <module>
    from email.utils import _has_surrogates
  File "C:\Users\Toshiba\AppData\Local\Programs\Python\Python38-32\lib\email\utils.py", line 31, in <module>
    import urllib.parse
  File "C:\Users\Toshiba\Desktop\urllib.py", line 2, in <module>
    from urllib3 import PoolManager
ImportError: cannot import name 'PoolManager' from partially initialized module 'urllib3' (most likely due to a circular import) (C:\Users\Toshiba\AppData\Local\Programs\Python\Python38-32\lib\site-packages\urllib3\__init__.py)
Mubin_Hardy
  • 53
  • 1
  • 9
  • That;s worked i renamed my python file from urllib to other.Thanks https://stackoverflow.com/users/5833429/tomasz-wojcik – Mubin_Hardy Jul 12 '20 at 17:13

1 Answers1

2

File "C:\Users\Toshiba\Desktop\urllib.py", line 2, in

One of your files is called urllib. Rename it.

That's one of the issues but I'm not sure it's the root cause of your problem. It seems like your installation is broken. If renaming this file didn't help, I'd suggest to start with a new virtualenv. If you're not using one, start with that.

Tom Wojcik
  • 5,471
  • 4
  • 32
  • 44