PIP Install Urllib2 prompts that the package cannot be found:
Note
The urllib2
module has been split across several modules inPython 3 named urllib.request
and urllib.error
.The 2to3 tool will automatically adapt imports when convertingyour sources to Python 3.
The urllib2 toolkit in Pyhton2 is split into urllib.request and urllib.error in Python3. This results in no package being found and no way to install.
So install urllib.request and install urllib.error are required, and then change the import urllib2 to import urllib.request and import urllib.error.
At the same time, the method function in the code also needs to be modified. Basically, urllib2.xxx is changed to urllib.request-xxx.
Official: https://docs.python.org/2/library/urllib2.html.
Read More:
- Ubuntu16.04 pip3 install PyAudio 出错:error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 1
- pip install – PermissionError: [Errno 13] Permission denied
- Solution: PIP install MySQL Python has the following problems
- Error in PIP install BS4 under Linux
- # pip install scipy — distutils.errors.LinkError: Command
- How to Fix Error in python3 | PIP install Dlib
- Syntaxerror: invalid syntax when executing PIP install XXX
- Solution to syntaxerror: invalid syntax in PIP install XXX
- python3 (pip3 install threading: ERROR: Cloud not find a version that satisfies the requirement ..)
- Error encountered while executing PIP install: error: complete output from command Python setup.py egg_ info:
- Using pip to install tensorflow: tensorflow — is not a supported wheel on this platform
- Solve the problem of syntax error: invalid syntax in PIP install XXX
- import Error:Missing optional dependency ‘openpyxl‘. Use pip or conda to install openpyxl
- Error syntax error: invalid syntax in PIP install XXX
- The Python PIP installation module prompts the error failed to create process
- PIP report failed to create process
- Mac Upgrade pip WARNING: You are using pip version 21.1.1; however, version 21.1.3 is available. You s
- pygobject pip3 upgrade problem: ERROR: Failed building wheel for pycairo
- Android Studio Install Error Failed to install Intel HAXM. For details, please check the installation log
- Configuration (9) to solve the problem of “setup tools PIP wheel failed with error code 1”, create virtual environments with Python of anaconda