When attempting to import the requests module in Python 3.4.0 I receive the following error: ImportError: No module named 'requests'
The requests
module in previous version of Python required that you use pip
separately. But according to the new features in Python 3.4.0, pip
is built in: https://docs.python.org/3.5/whatsnew/3.4.html#whatsnew-pep-453
My import line is simply:
import requests
I am confused as to why this is not working. All help is greatly appreciated.
Having
pip
included is meant to ease retrieving new packages. It does not state that all modules reachable through pip are bundled in new Python (hopefully !).You are still required to
pip install requests
before using the packagerequests
.Edit: following another question, it seems dependencies on requests are flawed. Then try:
as suggested by mentioned SO question.
Although
pip
is built-in, you still have to callpip install requests
.pip
is just the tool for downloading, not the actual item. To download, use the following:You don't have to install
pip
, but you still have to use it to install other items.Answering your comment, run the
pip install
again, this time with asudo
. You should see the following message:Or something of the likes. Then run this:
If the
import
fails, go to the above directory and search for the files.There is a possible answer here.
pip
for python 3:sudo apt-get install python3-pip
pip3
to install request module:pip3 install requests
If you get permission denied error, run the previous command in sudoers mode:
sudo pip3 install requests