I would like to import urllib to use the function 'request'. However, I encountered an error when trying to download via Pycharm: 
"Could not find a version that satisfies the requirement urllib (from versions: ) No matching distribution found for urllib"
I tried pip install urllib but still had the same error. I am using Python 2.7.11. Really appreciate any help
urllib. request is part of the standard library and does not need installing.
NOTE: urllib2 is no longer available in Python 3.
A few things:
urllib is not installed through pip, it is part of the standard library, so you can just do import urllib without installation. urllib.request module, but Python 2.x does not, as far as I know.The functionality that you are looking for from urllib.request is most likely contained in urllib2 (which is also part of the standard library), but you might be even better off using requests, which probably does need to be installed through pip in your case:
pip install requests
In fact, the urllib2 documentation itself recommends that you use the requests library "for a higher-level HTTP client interface" - but I am not sure what you wish to do, so it is hard to say what would be best for your particular use case. 
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With