I've refactored Django's setup.py so that it uses the plain Python distutils installation method rather than ez_setup/setuptools. This means it no longer requires an Internet connection to install Django. Hooray!
But I have only tested this on Linux, so I'd appreciate it if folks could test out the command "python setup.py install" on various different platforms. Just grab the SVN version of Django and try installing it using "python setup.py install".
For the record, we previously discussed this on django-developers here:
The "straw that broke the camel's back," in this case, happened this weekend when I was doing a Django tutorial in Boston and encountered two people who'd had problems installing Django due to a setuptools problem that was out of our control. (Namely, it was due to the fact that Python 2.5's version of setuptools required a certain version of ez_setup, or vice versa, or some other peculiar problem like that, which was out of our control.)
There was something about seeing this problems in real life, with face-to-face conversations with real Django users, that finally put me over the edge.
Adrian
-- Adrian Holovaty holovaty.com | djangoproject.com
On 10/16/06, Adrian Holovaty <holov...@gmail.com> wrote:
> But I have only tested this on Linux, so I'd appreciate it if folks > could test out the command "python setup.py install" on various > different platforms. Just grab the SVN version of Django and try > installing it using "python setup.py install".
Works fine with OS X 10.4.8 (PPC) + python 2.4.3 via darwinports.
On 10/16/06, Adrian Holovaty <holov...@gmail.com> wrote:
> But I have only tested this on Linux, so I'd appreciate it if folks > could test out the command "python setup.py install" on various > different platforms. Just grab the SVN version of Django and try > installing it using "python setup.py install".
Python 2.5 with OS X 10.4.8 (Intel) seems fine. I'll try Python 2.4 with OS X 10.3.9 when I get home.
I checked, and django-admin.py did get moved into the scripts directory, but I couldn't find any of the other files in any directory in or under C:\Python24.
> I checked, and django-admin.py did get moved into the scripts > directory, but I couldn't find any of the other files in any directory > in or under C:\Python24.
On 17/10/06, Adrian Holovaty <holov...@gmail.com> wrote:
> Hi all,
> I've refactored Django's setup.py so that it uses the plain Python > distutils installation method rather than ez_setup/setuptools. This > means it no longer requires an Internet connection to install Django. > Hooray!
> But I have only tested this on Linux, so I'd appreciate it if folks > could test out the command "python setup.py install" on various > different platforms. Just grab the SVN version of Django and try > installing it using "python setup.py install".
In the buildbot slave I'm setting up for pybots.org I get a problem with the old setuptools version of django-admin.py not being replaced by the real one.
My setup has a temporary python2.5 build in /tmp/python-buildbot/local/bin/python with django trunk r3905 (pre-setuptools removal) installed in /tmp/python-buildbot/local/lib/python2.5/site-packages.
If I do a '/tmp/python-buildbot/local/bin/python setup.py install' with the latest trunk it doesn't replace the /tmp/python-buildbot/local/bin/django-admin.py script or remove the old django egg. If I then go and remove the old egg from site-packages django-admin.py breaks.
If I do a completely clean install without a previous setuptools version of django present then it works fine. This is on a Solaris 10 system with python 2.5.
> The "straw that broke the camel's back," in this case, happened this > weekend when I was doing a Django tutorial in Boston and encountered > two people who'd had problems installing Django due to a setuptools > problem that was out of our control. (Namely, it was due to the fact > that Python 2.5's version of setuptools required a certain version of > ez_setup, or vice versa, or some other peculiar problem like that, > which was out of our control.)
> There was something about seeing this problems in real life, with > face-to-face conversations with real Django users, that finally put me > over the edge.
> Adrian
> -- > Adrian Holovaty > holovaty.com | djangoproject.com
DavidA wrote: > Works on Windows 2003 Server SP1 + Python 2.4.2
I spoke too soon. I tried to run 'manage.py test' and it complained about an invalid action so I poked around and the management.py in C:\Python24\lib\site-packages\django\core was different than the one in the SVN checkout directory (that I had just done an install from).
I figured it installed the old stuff in the build directory so I remove the build directory and re-ran 'setup.py install' and now I get this error:
C:\Django\trunk>setup.py install running install running build running build_py running build_scripts creating build creating build\scripts-2.4 copying and adjusting django\bin\django-admin.py -> build\scripts-2.4 running install_lib warning: install_lib: 'build\lib' does not exist -- no Python modules to install
I tried manually creating 'build\lib' but that didn't help (it still doesn't build or install). I also tried 'setup.py build' and it does nothing. I then tried removing the django installation directory in lib\site-packages and it still won't install anything.
Now I've sort of hosed myself - guess I'll downgrade... -Dave
I tried again as 'python setup.py install' rather than 'setup.py install' and it worked. For some reason my file type mapping on this particular Win box was mucked up.
I missed the previous discussion, but I'm not pleased with this change.
The developer version of Django is made available only via Subversion, so the requirement for internet access at install is hardly a disadvantage. Django is, after all, a web framework!
The best way to install development Django on a Windows system has been to use the setuptools-provided command:
setup.py develop
With setuptools, this command copies nothing to site-packages except a setuptools-based link to the Django checkout, and Django is easily kept up to date with svn up. SInce Windows has no built-in linking, this setuptools-based linking is quite useful, and especially for newbies!
This same installation approach has in my experience worked worked equally well on linux. (That this approach has not been mentioned at the front of the tutorial is an issue with the tutorial, not with setuptools. I first discovered it in the comments section for tutorial 1.)
On Oct 16, 5:03 pm, "Adrian Holovaty" <holov...@gmail.com> wrote:
> I've refactored Django's setup.py so that it uses the plain Python > distutils installation method rather than ez_setup/setuptools. This > means it no longer requires an Internet connection to install Django. > Hooray!
> But I have only tested this on Linux, so I'd appreciate it if folks > could test out the command "python setup.py install" on various > different platforms. Just grab the SVN version of Django and try > installing it using "python setup.py install".
> For the record, we previously discussed this on django-developers here:
> The "straw that broke the camel's back," in this case, happened this > weekend when I was doing a Django tutorial in Boston and encountered > two people who'd had problems installing Django due to a setuptools > problem that was out of our control. (Namely, it was due to the fact > that Python 2.5's version of setuptools required a certain version of > ez_setup, or vice versa, or some other peculiar problem like that, > which was out of our control.)
> There was something about seeing this problems in real life, with > face-to-face conversations with real Django users, that finally put me > over the edge.
> Adrian
> -- > Adrian Holovaty > holovaty.com | djangoproject.com
> The developer version of Django is made available only via Subversion, > so the requirement for internet access at install is hardly a > disadvantage. Django is, after all, a web framework!
It is, but the setuptools requirement of an active internet connection makes it *extremely* difficult to use setuptools for things like automated installs on multiple machines -- it's not uncommon for servers to be installed, or mostly installed, while totally offline or when connected only to a private backplane. With setuptools that just wasn't possible.
> With setuptools, this command copies nothing to site-packages except a > setuptools-based link to the Django checkout, and Django is easily kept > up to date with svn up. SInce Windows has no built-in linking, this > setuptools-based linking is quite useful, and especially for newbies!
It's a tradeoff, though, because setuptools seems to be extremely brittle -- even minor changes in the easy_install/setuptools chain can apparently break the entire system, and that's much, much worse.
In the long run, I think this change is for the best; issues with easy upgrades of SVN checkouts can be worked around, but not being installable on disconnected machines, or not being installable at all for a while whenever the easy_install stuff changes upstream, are much more severe and much harder to work around.
-- "May the forces of evil become confused on the way to your house." -- George Carlin
Is there any reason to use either setuptools or distutils if one is doing an automated install of Django? Isn't it just copy or link the django directory to the Python path, copy django-admin.py to an executable path, and you are pretty much done?
How would one now recommend that a new Windows developer install Django in a such a way as to facilitate keeping his Django updated to the trunk?
The easiest to explain approach that I know about would be to ignore Django's setup.py. Instead install setuptools, manually create a Django.eggs-link file in site-packages, and then copy django-admin.py to the Python scripts directory. There are other ways - mostly involving access to Windows' painful UI for creating persistent environment variables - but they are not easier to explain or perform than the technique I just described
Thus this change seems like a regression in the ease of a best-practices installation for new developers on Windows.
And in defense of Phillip Eby's very laudable efforts, I suspect that the vast majority of all issues with the setuptools install would have been resolved by simply changing the instructions to:
1) First download and run the latest ez_setup.py 2 Checkout Django trunk 2) Then run python setup.py develop
And users on all platforms would have then had a Django that is easily updated by svn up.
sbain wrote: > How would one now recommend that a new Windows developer install Django > in a such a way as to facilitate keeping his Django updated to the > trunk?
I only dabble with Django from time to time, but here is how I have it set up (the following assumes C:\Python24\ as the root):
1. svn checkout into Lib/site-packages/django-src
2. Create Lib/site-packages/django.pth file with the following line as its only content: django-src
3. Create Scripts/django-admin.bat file with the following line as its only content: @python C:\Python24\Lib\site-packages\django-src\django\bin\django-admin.py %*
4. Make sure C:\Python24\Scripts is on your PATH, and django-admin works just like it does in the documentation.
5. Stay up to date with svn up Lib/site-packages/django-src
A slight pain to set it up this way, but once everything is in place it is smooth sailing. I did all this specifically because I didn't want to use setuptools/ez_install.
Adrian Holovaty wrote: > I've refactored Django's setup.py so that it uses the plain Python > distutils installation method rather than ez_setup/setuptools. This > means it no longer requires an Internet connection to install Django. > Hooray!
On Oct 16 2006, 2:03 pm, "Adrian Holovaty" <holov...@gmail.com> wrote:
> I've refactored Django's setup.py so that it uses the plain Python
> distutils installation method rather than ez_setup/setuptools. This
> means it no longer requires an Internet connection to install Django.
> Hooray!
From what I've seen your real complaints have all been with the
ez_setup behavior, and not setuptools itself. It's ez_setup that
requires an internet connection so that it can bootstrap setuptools if
it's not already installed. Setuptools only requires a connection if
you want to use the dependency feature. So, from what I can tell your
problems should have been fixed with a 2-line change to remove
ez_setup from setup.py. If you prefer to stick with distutils, that's
fine, but don't give up on setuptools just because of ez_setup.