Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No module named 'requests' Python 3.5.0

I need to use requests in my code but it says that it's not installed. I get the following error: No module named 'requests'. It's actually installed and works in python 2.7: Requirement already satisfied (use --upgrade to upgrade): requests in /Library/Python/2.7/site-packages. I searched a lot and tried to reinstall it, to download missing libraries, and etc... but nothing helped. How can I make it work on python 3.5 ?

like image 288
Steve Avatar asked Oct 24 '15 19:10

Steve


1 Answers

Python 2 and 3 (and their packages) can be installed and co-exist independently of one another. I would suggest using pip as the best way to install Python packages (and keep them up-to-date).

  1. Install pip for Python 3 – using one of the following methods:

    • easy_install (may be available as easy_install-3.5),
    • the distribution package manager (if running GNU/Linux) or
    • python -m ensurepip (thanks, Mark Dickinson)
  2. Use pip to install the requests module:

    pip3 install requests
    
like image 54
Anthony Geoghegan Avatar answered Nov 15 '22 15:11

Anthony Geoghegan