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 al
Manually include urllib.parse: https://docs.python.org/3.3/library/urllib.parse.html#module-urllib.parse
pip install -U websocket
I just use this to fix my problem
For Python 3, use the following:
import 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
You want urlparse using python2:
from urlparse import urlparse