Detailed map traversal, teach you to master the complex gremlin query debugging method>>>
ModuleNotFoundError No module named urllib2? So in the process of editing to develop code, there will be errors in the code, which is also caused by differences in versions
Tools/raw materials
python3
Method/step
After using python3 to import urllib2 package, when developing code, the message of modulenotfoundererror no module named urllib2 will appear
You can see that the current import is import urllib2
First of all, you need to confirm what version of Python the current project file uses. Click the fill — settings option
Enter the settings interface and select the project interpreter option. What you can see is for Python 3
Modify the code and change the import to inport urllib. Request
After the modification, after the current code, you can see that no error will be reported
Similar Posts:
- No module named ‘urllib.request’; ‘urllib’ is not a package
- After installing BS4 in Python, pychar still reports module not found error: no module named ‘BS4’
- How to Solve Centos Yum Error: No module named yum
- Pycharm cannot import the third-party library no module named urllib3
- Python: Centos + gunicorn+flask ImportError: No module named request
- The solution of module ‘urllib’ has no attribute ‘request’
- [Solved] Python3 Error: ModuleNotFoundError: No module named ‘_bz2’
- [Solved] peewee error: ImportError: No module named ‘MySQLdb’;pymysql error: from . import connections # noqa: E402
- [Solved] rosrun import rospy Error: ImportError: No module named yaml
- ImportError: No module named ‘requests’