I'm trying to run a REST API on CentOS 7, I read urllib.parse is in Python 3 but I'm using Python 2.7.5 so I don't know how to install this module.
I installed all the requirements but still can't run the project.
When I'm looking for a URL I get this (I'm using the browsable interface):
Output:
ImportError at /stamp/
No module named urllib.parse
If you need to write code which is Python2 and Python3 compatible you can use the following import
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse