0

I'm a complete beginner in Python programming. I have trouble installing/importing the module 'requests' on python. When I use my command terminal to install requests, I get a message that requests is already installed. However, when I try to import requests into the file I'm working on, python tells me there is no such module installed.

Sorry to bother you with this silly and probably easy question, thanks in advance!

titusAdam
  • 779
  • 1
  • 16
  • 35

1 Answers1

1

If you use PyCharm (which is a great choice in my opinion), go to the tab Run and select Edit Configuration and in the window that just opened make sure the your Python interpreter is the one you used when you pip installed the package you asked about.

You can check your Python version or just see in PyCharm if the requests is actually installed by going to the tab File, select Settings, click on Project: name_of_your_project and finally check in Project Interpreter that the package is installed.

Community
  • 1
  • 1
Lior Magen
  • 1,533
  • 2
  • 15
  • 33
  • Thanks for your reply. When I try to install requests through pycharm though, I get the following error: Try to run this command from the system terminal. Make sure that you use the correct version of 'pip' installed for your Python interpreter located at '/Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5'. – titusAdam Apr 11 '16 at 10:45
  • In fact I'm not able to install any package at all – titusAdam Apr 11 '16 at 10:56
  • I'm not talking about installation of packages through PyCharm. Install them using pip but you can make sure it's installed using PyCharm. First make sure which Python version PyCharm uses and let me know. – Lior Magen Apr 11 '16 at 10:58
  • They're not installed! :) I'm using python 3.5 – titusAdam Apr 11 '16 at 11:02
  • 1
    Ok good. Now you need to [change your default Python version](http://stackoverflow.com/questions/5846167/how-to-change-default-python-version) and than re-install the package you want to (using pip install), after this go to PyCharm and check again if the package is installed. – Lior Magen Apr 11 '16 at 11:04
  • @titusAdam Great! Plz accept my answer and good luck coding :) – Lior Magen Apr 11 '16 at 11:30