Downloading distribute on install

19 views
Skip to first unread message

Phil Wills

unread,
Jul 7, 2010, 1:47:13 PM7/7/10
to mockito-python
Hi all, in general I'm really enjoying working with mockito-python,
but I've got a bit of a problem with the way it's distributed.

In the setup.py it makes a call to use_setuptools in
distribute_setup.py which can end up trying to download the distribute
package from pypi.python.org. I'm attempting to run it an environment
where there's no connection to the internet, but we're managing our
dependencies via pip talking to an internal pypi server and when it
tries to install mockito, it fails when attempting to connect to
pypi.python.org.

My knowledge of setup_tools/distribute/pip is fairly limited and
wondered if there's a solution for this that doesn't involve me
changing the DEFAULT_URL in distribute_setup.py and then uploading a
modified tarball to our internal pypi server.

Thanks for your help,

Phil

Serhiy Oplakanets

unread,
Jul 7, 2010, 2:08:30 PM7/7/10
to mockito-python
Hi Phil,
As a temporary fix I just found out that if both "setuptools" and
"distribute" are already installed setup script will not try to
download it again.
Hope it works as a temporary fix for you.
I should dive into setuptools for a more solid fix I'm afraid, I
believe it's not a mockito setup issue.

P.S. Glad you enjoy mockito. Me too :) Any feature-requests/bugs? ;-)

Phil Wills

unread,
Jul 8, 2010, 6:33:15 AM7/8/10
to mockito-python
The thing is I'm actually using virtualenv and do have a copy of
setuptools available within that, but the logic in distribute_setup.py
doesn't seem to be recognising that fact. Other libraries I'm using,
such as nosetests appear to work on the assumption that either
setuptools or distribute are installed and don't try to download one
if not. I'm curious as to why mockito-python tries to attempt this
when installing almost anything without one of those two is likely to
fail.

Phil

Serhiy Oplakanets

unread,
Jul 8, 2010, 6:39:49 AM7/8/10
to mockito-python
Phil, I was using setuptools too, when trying to reproduce your error.
What I was doing:
$ virtualenv --no-site-packages ./env
$ ./env/bin/pip install setuptools distribute
$ ./env/bin/python setup.py install

An all went fine (I disconnect from network on last step).

About why mockito-python is acting diffenretly -- I can't say, maybe
different version of distribute or so. I will investigate it.
For now -- hope my solution above will work for you.

Serhiy Oplakanets

unread,
Jul 8, 2010, 6:44:36 AM7/8/10
to mockito-python
s/was using setuptools/was using *virtualenv*/
Reply all
Reply to author
Forward
0 new messages