No module named urllib3

后端 未结 5 2137
花落未央
花落未央 2021-02-13 04:58

I wrote a script to call an API and ran it successfully last week. This week, it won\'t run. I get back the following error message:

Traceback (most recent call          


        
相关标签:
5条回答
  • 2021-02-13 05:10

    Either urllib3 is not imported or not installed.

    To import, use

    import urllib3
    

    at the top of the file. To install write:

    pip install urllib3
    

    into terminal.

    It could be that you did not activate the environment variable correctly. To activate the environment variable, write

    source env/bin/activate
    

    into terminal. Here env is the environment variable name.

    0 讨论(0)
  • 2021-02-13 05:11

    For me in PyCharm I had to put import urllib3 at the top of the file as mentioned earlier then PyCharm gave the option to import. Even after installing it with pip

    0 讨论(0)
  • 2021-02-13 05:23

    Few minutes back, I faced the same issue. And this was because, I used virtual environment. I believe that due to venv directory, the pip installed might have stopped working.

    Fortunately, I have setup downloaded in my directory. I ran the setup and chose the option to repair, and now, everything works fine.

    0 讨论(0)
  • 2021-02-13 05:31

    set you environment by writing source env/bin/activate if env not found write virtualenv env first then source env/bin/activate , then check pip freeze if urllib3 not found there then reinstall urllib3, hope it helps.

    0 讨论(0)
  • 2021-02-13 05:33
    pip install urllib3 
    

    The reason it broke is that I had installed an incompatible version of urllib3 as a transient dependency of awscli. You'll see such conflicts when you rerun the install.

    0 讨论(0)
提交回复
热议问题