arianna p
arianna p

Reputation: 71

How to install requests module with pip? Is pip properly installed?

I do not know whether pip has been installed correctly. I used easy_install

It installed pip script to: /Library/Frameworks/Python.framework/Versions/2.7/bin

However when I enter "pip" I get a list of commands and general options not an error

but when I try to install requests I get:

Downloading/unpacking requests
Cannot fetch index base URL (https://pypi.python.org/simple/).
Could not find any downloads that satisfy the requirement requests

$ python get-pip.py
Downloading/unpacking pip
Cannot fetch index base URL (https: //pypi.python. org/simple/).
Could not find any downloads that satisfy the requirement pip
Cleaning up...
No distributions at all found for pip
Storing debug log for failure in /Users/ariannaroyrp/.pip/pip.log


$ sudo python get-pip.py

WARNING: Improper use of the sudo command could lead to data loss
or the deletion of important system files. Please double-check your
typing when using sudo. Type "man sudo" for more information.

To proceed, enter your password, or type Ctrl-C to abort.

Password:
Downloading/unpacking pip
Cannot fetch index base URL https://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement pip
Cleaning up...
No distributions at all found for pip
Storing debug log for failure in /Users/ariannapryor/.pip/pip.log

$ sudo python ez_install pip
Password:
/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacO/Python: can't open file 'ez_install': [Errno 2] No such file or directory


$ sudo python easy_install pip
/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacO/Python: can't open file 'easy_install': [Errno 2] No such file or directory

$ easy_install pip
Searching for pip
Reading https: // pypi.python. org/simple/pip

Best match: pip 1.5.5
Downloading https: // pypi.python. org/packages/source/p/pip/pip-1.5.5.tar.gz#md5=7520581ba0687dec1ce85bd15496537b
Processing pip-1.5.5.tar.gz
Writing /var/folders/4x/15s0yxd96gd1lt_6xf1zt_x40000gn/T/easy_install-OwdJ8U/pip-1.5.5/setup.cfg
Running pip-1.5.5/setup.py -q bdist_egg --dist-dir /var/folders/4x/15s0yxd96gd1lt_6xf1zt_x40000gn/T/easy_install-OwdJ8U/pip-1.5.5/egg-dist-tmp-xzS1S9
warning: no files found matching 'pip/cacert.pem'
warning: no files found matching '*.html' under directory 'docs'
warning: no previously-included files matching '*.rst' found under directory 'docs/_build'
no previously-included directories found matching 'docs/_build/_sources'
Adding pip 1.5.5 to easy-install.pth file
Installing pip script to /Library/Frameworks/Python.framework/Versions/2.7/bin
Installing pip2.7 script to /Library/Frameworks/Python.framework/Versions/2.7/bin
Installing pip2 script to /Library/Frameworks/Python.framework/Versions/2.7/bin

Installed /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.5.5-py2.7.egg
Processing dependencies for pip
Finished processing dependencies for pip

$ pip install requests
Downloading/unpacking requests
Cannot fetch index base URL https:// pypi.python. org/simple/
Could not find any downloads that satisfy the requirement requests
Cleaning up...
No distributions at all found for requests
Storing debug log for failure in /Users/ariannaroyrp/.pip/pip.log

$ pip

Usage:   
  pip <command> [options]

Commands:
  install                     Install packages.
  uninstall                   Uninstall packages.
  freeze                      Output installed packages in requirements format.
  list                        List installed packages.
  show                        Show information about installed packages.
  search                      Search PyPI for packages.
  wheel                       Build wheels from your requirements.
  zip                         DEPRECATED. Zip individual packages.
  unzip                       DEPRECATED. Unzip individual packages.
  bundle                      DEPRECATED. Create pybundles.
  help                        Show help for commands.

General Options:
  -h, --help                  Show help.
  -v, --verbose               Give more output. Option is additive, and can be used up to 3 times.
  -V, --version               Show version and exit.
  -q, --quiet                 Give less output.
  --log-file <path>           Path to a verbose non-appending log, that only logs failures. This log
                          is active by default at /Users/ariannapryor/.pip/pip.log.
  --log <path>                Path to a verbose appending log. This log is inactive by default.
  --proxy <proxy>             Specify a proxy in the form [user:passwd@]proxy.server:port.
  --timeout <sec>             Set the socket timeout (default 15 seconds).
  --exists-action <action>    Default action when a path already exists: (s)witch, (i)gnore, (w)ipe,
                          (b)ackup.
  --cert <path>               Path to alternate CA bundle.


$ pip install requests
Downloading/unpacking requests
  Cannot fetch index base URL https:// pypi.python. org/simple/
  Could not find any downloads that satisfy the requirement requests
Cleaning up...
No distributions at all found for requests
Storing debug log for failure in /Users/ariannaroyrp/.pip/pip.log

Can someone please explain to me what is going on here?

Upvotes: 2

Views: 12548

Answers (1)

Jan Vlcinsky
Jan Vlcinsky

Reputation: 44132

All your messages are reporting the same problem:

Cannot fetch index base URL https:// pypi.python. org/simple/

Notice the space in between https:// and pypi...

It looks like you have somewhere configured --index and it has wrong value.

The best is to remove all the means affecting the configuration and run "clean" way

Configuration describes following methods

  • configuration file
  • environmental varible

As command line switches are taking precedence, you might try:

$ pip install requests --index "http://pypi.python.org/"

But if you succeed, you shall definitely research, where you messed up your pip configuration.

Upvotes: 1

Related Questions