How to fix Python 3 ModuleNotFoundError: No module named 'urlparse'
Problem:
While trying to import urlparse in Python 3 using
import_urlparse_error.py
import urlparseyou see the following error message:
import_urlparse_traceback.txt
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Input In [29], in <cell line: 1>()
----> 1 import urlparse
ModuleNotFoundError: No module named 'urlparse'Solution
In Python 3, urlparse has been renamed to urllib.urlparse. In order to import it, use this line instead:
fix_import.py
from urllib.parse import urlparseCheck out similar posts by category:
Python
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow