Kiran Kumar Reddy
Kiran Kumar Reddy

Reputation: 41

No module named parse

I am getting the following error -

Traceback (most recent call last):
  File "kiran.py", line 5, in <module>
    from urllib.parse import urlparse, parse_qs
ImportError: No module named parse

I have tried using

pip install -U websocket
pip install parse

but still error is coming

Upvotes: 2

Views: 17184

Answers (1)

Martijn Pieters
Martijn Pieters

Reputation: 1122082

You are trying to use code designed for Python 3, in Python 2.

The functionality of the Python 3 urllib.parse module is found in the urlparse module in Python 2, so you want to adjust your code. You do not need to install other packages.

However, if you are following a tutorial or copying code from the web, you need to switch to Python 3 instead. There will be other issues with the code not running on Python 2.

Upvotes: 2

Related Questions