Whenever I run .py code using terminal (ubuntu).
I get this error.
Traceback (most recent call last):
File "./twitterstream.py", line 15, in <module>
from pip._vendor import requests
File "/usr/local/lib/python2.7/dist-packages/pip-10.0.1-py2.7.egg/pip/_vendor/requests/__init__.py", line 83, in <module>
from pip._internal.compat import WINDOWS
File "/usr/local/lib/python2.7/dist-packages/pip-10.0.1-py2.7.egg/pip/_internal/__init__.py", line 42, in <module>
from pip._internal import cmdoptions
File "/usr/local/lib/python2.7/dist-packages/pip-10.0.1-py2.7.egg/pip/_internal/cmdoptions.py", line 16, in <module>
from pip._internal.index import (
File "/usr/local/lib/python2.7/dist-packages/pip-10.0.1-py2.7.egg/pip/_internal/index.py", line 15, in <module>
from pip._vendor import html5lib, requests, six
ImportError: cannot import name requests
All the errors are import errors. (pip)
I have tried reinstalling pip and python.
Any suggestions on this?
Little bit late, but just came to the same error as described here. However none of the suggested answers fixed my issue.
In my case pip
was installed from OS' package manager (python-pip
in Arch Linux) as well as requests (which is a dependency of the first).
After removing requests using pip (sudo pip uninstall requests
) I ended up with this error.
Fixed by reinstalling using my distro's package manager (pacman -Sy python-requests
).
write on your terminal
pip install requests
beacause you didnt Installed Yet requests module , And you can install every Module by pip , pip install urlib2 , pip install readlines , pip install termcolor etc//
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With