0

still advancing in my tutorial to learn python, I am told to do that :

sudo pip install requests

here is what I get in return :

"

The directory '/Users/gui/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. The directory '/Users/gui/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. Collecting requests Could not fetch URL https://pypi.python.org/simple/requests/: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping Could not find a version that satisfies the requirement requests (from versions: ) No matching distribution found for requests

"

--> would you know what I would need precisely to correct (I'm a newbie so if you can be very detailed in your help explanation it would be awesome) ?

thanks a lot in advance

gRookie
  • 89
  • 1
  • 1
  • 5
  • Possible duplicate of ["SSL module in Python is not available" when installing package with pip3](https://stackoverflow.com/questions/41328451/ssl-module-in-python-is-not-available-when-installing-package-with-pip3) – phd Mar 04 '18 at 15:04

2 Answers2

0

Normally you should be able to install the modules using the below commands: -> sudo pip install requests but incase if you get some errors stating "'sudo' is not recognized as an internal or external command, operable program or batch file.", then go with below command and give a try. -> easy_install requests and this will help you fulfill your requirement by installing the required "requests" module.

-1

So as it says in the error message you may want to try sudo -H pip install requests.

This -H options sets the HOME environment variable to the superusers home instead of your users home. As when you run a command with sudo it is run as a superuser not as your standard user

You could also try running the command without sudo at the front as that may not be required

hwhite4
  • 695
  • 4
  • 6
  • thank you, but when doing "sudo -H pip install requests" or when doing "pip install requests", in both cases I still get the following message error : pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. Collecting requests Could not fetch URL https://pypi.python.org/simple/requests/: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping Could not find a version that satisfies the requirement requests (from versions: ) No matching distribution found for requests – gRookie Mar 04 '18 at 10:59