Cannot install urllib2 for python 2.7

I am trying to install the urllib2 module for python 2.7 (I, as usual, use the pip install command), but I have an error

No suitable distribution found for urllib2 ..

What should I do?

+6
source share
1 answer

You do not need to specify urlib / urllib2

In Python 2.7 , urllib and urllib2 comes with python.

import urllib 

OR

 import urllib2 

In Python 3+, urllib2 is replaced with urllib.request.

  import urllib.request as urllib2 
+9
source

Source: https://habr.com/ru/post/1014081/


All Articles