Forums

Problem installing Django in virtualenv

Hi, I followed instructions from https://www.pythonanywhere.com/wiki/VirtualEnvForNewerDjango : source virtualenvwrapper.sh mkvirtualenv django16 which pip (which gives: /home/kukrak/.virtualenvs/django16/bin/pip)

But when I invoked: pip install django (earlier I activated django16) I got: Downloading/unpacking django Cannot fetch index base URL https://pypi.python.org/simple/ Could not find any downloads that satisfy the requirement django No distributions at all found for django Storing complete log in /home/kukrak/.pip/pip.log

Content of pip.log: /home/kukrak/.virtualenvs/django16/bin/pip run on Sun Apr 6 15:55:30 2014 Downloading/unpacking django

Getting page https://pypi.python.org/simple/django/ Could not fetch URL https://pypi.python.org/simple/django/: <urlopen error [Errno 111] Connection refused> Will skip URL https://pypi.python.org/simple/django/ when looking for download links for django Getting page https://pypi.python.org/simple/ Could not fetch URL https://pypi.python.org/simple/: <urlopen error [Errno 111] Connection refused> Will skip URL https://pypi.python.org/simple/ when looking for download links for django Cannot fetch index base URL https://pypi.python.org/simple/

URLs to search for versions for django: * https://pypi.python.org/simple/django/ Getting page https://pypi.python.org/simple/django/ Could not fetch URL https://pypi.python.org/simple/django/: <urlopen error [Errno 111] Connection refused> Will skip URL https://pypi.python.org/simple/django/ when looking for download links for django Could not find any downloads that satisfy the requirement django

No distributions at all found for django

Exception information: Traceback (most recent call last): File "/home/kukrak/.virtualenvs/django16/local/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/basecommand.py", line 139, in main status = self.run(options, args) File "/home/kukrak/.virtualenvs/django16/local/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/commands/install.py", line 266, in run requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle) File "/home/kukrak/.virtualenvs/django16/local/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/req.py", line 1026, in prepare_files url = finder.find_requirement(req_to_install, upgrade=self.upgrade) File "/home/kukrak/.virtualenvs/django16/local/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/index.py", line 171, in find_requirement raise DistributionNotFound('No distributions at all found for %s' % req) DistributionNotFound: No distributions at all found for django

What is going on ? Please help.

Regards Kuba

Our proxy server had a nervous breakdown. It's feeling better now.

Thanks for reply - now it works!

Running into this same issue.

Me too: https://www.pythonanywhere.com/forums/topic/1544/

Hi there -- unfortunately the proxy that handles HTTP access for free accounts had crashed. Looks like someone had (probably inadvertently) DoSed it. We've restarted it, so it should work now, and we are trying to work out how to guard against this kind of problem.

It looks like this issue is back. From inside a vritual env :

pip3.4 install lxml

Collecting lxml

Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionRefusedError(111, 'Connection refused'))': /simple/lxml/

It's definitely not the same problem -- the proxy is up and running, and has been since 22 May. But right, definitely something's wrong if you can't install lxml. What do you get if you run the env command from a Bash console? You should see (amongst other things) HTTP proxy environment variables like this:

http_proxy=http://proxy.server:3128
https_proxy=http://proxy.server:3128

I guess this in on me. If i run the env command from inside a bash console from the pythonanywhere site, I do have the http_proxy env variables set. And I just successfuly installed lxml. But, if i run the env command from inside an ssh session, I do not have those variable set. That's certainly why the install failed. Thank you.

Ah, I see the problem. Because normally only paying customers can access PythonAnywhere via ssh, and they don't need the proxy, we don't automatically set those variables for them. But I see that we enabled ssh on your account because of some AZERTY keyboard issues, so our assumption that no ssh users need the proxy was wrong for you.

If you put this in your .bashrc (or run it when you first log in via ssh) then everything should work better:

export http_proxy=http://proxy.server:3128
export https_proxy=http://proxy.server:3128