question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Having http_proxy='' in env causes "Cannot fetch index base URL"

See original GitHub issue
pip install --use-mirrors virtualenv
Downloading/unpacking virtualenv
  Cannot fetch index base URL http://pypi.python.org/simple/
  Could not find any downloads that satisfy the requirement virtualenv
No distributions at all found for virtualenv
Storing complete log in /Users/reyzlin/.pip/pip.log

Here’s the log /Users/reyzlin/.pip/pip.log:

cat /Users/reyzlin/.pip/pip.log
------------------------------------------------------------
/usr/local/bin/pip run on Mon Mar 12 10:51:54 2012
Downloading/unpacking yolk
  Getting page http://pypi.python.org/simple/yolk
  Could not fetch URL http://pypi.python.org/simple/yolk: timed out
  Will skip URL http://pypi.python.org/simple/yolk when looking for download links for yolk
  Getting page http://pypi.python.org/simple/
  Could not fetch URL http://pypi.python.org/simple/: timed out
  Will skip URL http://pypi.python.org/simple/ when looking for download links for yolk
  Cannot fetch index base URL http://pypi.python.org/simple/
  URLs to search for versions for yolk:
  * http://pypi.python.org/simple/yolk/
  Getting page http://pypi.python.org/simple/yolk/
  Could not fetch URL http://pypi.python.org/simple/yolk/: timed out
  Will skip URL http://pypi.python.org/simple/yolk/ when looking for download links for yolk
Operation cancelled by user
Exception information:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip-1.0.2-py2.7.egg/pip/basecommand.py", line 126, in main
    self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip-1.0.2-py2.7.egg/pip/commands/install.py", line 223, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/Library/Python/2.7/site-packages/pip-1.0.2-py2.7.egg/pip/req.py", line 954, in prepare_files
    url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
  File "/Library/Python/2.7/site-packages/pip-1.0.2-py2.7.egg/pip/index.py", line 137, in find_requirement
    for page in self._get_pages(locations, req):
  File "/Library/Python/2.7/site-packages/pip-1.0.2-py2.7.egg/pip/index.py", line 225, in _get_pages
    t.join()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 642, in join
    self.__block.wait()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 238, in wait
    waiter.acquire()
KeyboardInterrupt

I then check for http env variables:

env | grep -i http
http_proxy=

So I have an empty http_proxy variable. Should it fail with that?

After doing

unset http_proxy

And running

pip install --use-mirrors virtualenv

I can install it no problem.

Should it behave this way?

Thanks!

Issue Analytics

  • State:closed
  • Created 12 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
samkhan13commented, Jun 22, 2012

i was having the same problem while trying to install virtualenv. i do have a proxy server and other things like curl, port, etc. are able to use my environment variables. but pip doesn’t seem to recognize them so i have to provide my proxy to it each time i use it.

things worked out for me when i used my proxy settings with the command

sudo pip --proxy=http://username:password@proxyURL:portNumber install virtualenv

give it a try if you are actually behind a proxy server. if you are not, then i’m afraid i can’t diagnose your problem. though i’d guess that you have some kind of network connectivity issue.

0reactions
double12gzhcommented, Jun 7, 2016

I setup the HTTPS but with the samve error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

6 Answers - 6 - Stack Overflow
I'm trying to install several packages using pip. When I do this using sudo, this error occurs: "Cannot fetch index base URL https://pypi.python ......
Read more >
Error while installing with Python "pip": Cannot fetch index ...
That's very odd, the URL works fine on another computer, and wgetting the main page works fine. EDIT: In my case, I had...
Read more >
python - iTecNote
pipproxypython. I'm trying to install several packages using pip. When I do this using sudo, this error occurs: "Cannot fetch index base URL...
Read more >
Posted on - Brad's Place – Blog
pip – Cannot fetch index base URL http://pypi.python.org/simple/ · Start by initialising virtualenv and activating it · Update pip and override ...
Read more >
cannot fetch index base url : Forums - pip install
Our proxy was taken down by an internal DDOS overnight. As a free user you can only connect to the internet via the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found