[Zope3-Users] Buildout and custom python

David Pratt fairwinds at eastlink.ca
Thu Dec 20 20:03:44 EST 2007


Hey Darryl. Our minds were in a similar place today. I finally had 
decided to move away from my system python starting on my mac and also 
having a spot of trouble. I put something simple together below to 
illustrate what happened in my instance.

Here the eggs built with the python would not install. I initially 
though it was the lxml I was compiling, but it was just happened to be 
the first part requiring the custom-python. Eggs were made, and I could 
see the temp folder also, but when was finalizing the install, it threw 
the error and without much verbosity, the tempfolder it was installing 
into disappeared.

Note, I did not include the custom-python as a part in the buildout. I 
tend to like the python24:location type of notation since it is fairly 
explicit when you have a number of pieces of software you are building.

Regards
David

[buildout]
develop = .
parts = python24
         interpreter
index = http://download.zope.org/ppix
log-level = DEBUG

[python24]
recipe = zc.recipe:cmmi
url = http://python.org/ftp/python/2.4.4/Python-2.4.4.tgz

[custom-python]
executable = ${python24:location}/bin/python

[interpreter]
recipe = zc.recipe.egg
interpreter = interpreter
eggs = Cheetah==1.0
python = custom-python


Here are the highlights:

Some verification it is using the right python...

Getting distribution for 'Cheetah==1.0'.
We have the best distribution that satisfies 'setuptools'.
Picked: setuptools = 0.6c7
Running easy_install:
/Users/davidpratt/Desktop/Buildouts/osxdeploy2/parts/python24/bin/python 
"-c" "from setuptools.command.easy_install import main; main()" "-mUNxd" 
"/Users/davidpratt/Desktop/Buildouts/osxdeploy2/eggs/tmprQq-MH" "-v" 
"/Users/davidpratt/Desktop/Buildouts/download-cache/dist/Cheetah-1.0.tar.gz"
path=/Users/davidpratt/Desktop/Buildouts/osxdeploy2/eggs/setuptools-0.6c7-py2.4.egg

Processing Cheetah-1.0.tar.gz

Last few lines of output.. some time later.

changing mode of 
/Users/davidpratt/Desktop/Buildouts/osxdeploy2/eggs/tmprQq-MH/Cheetah-1.0-py2.4-macosx-10.3-ppc.egg/EGG-INFO/top_level.txt 
to 755
changing mode of 
/Users/davidpratt/Desktop/Buildouts/osxdeploy2/eggs/tmprQq-MH/Cheetah-1.0-py2.4-macosx-10.3-ppc.egg/EGG-INFO/scripts/cheetah 
to 755
changing mode of 
/Users/davidpratt/Desktop/Buildouts/osxdeploy2/eggs/tmprQq-MH/Cheetah-1.0-py2.4-macosx-10.3-ppc.egg/EGG-INFO/scripts/cheetah-compile 
to 755

Installed 
/Users/davidpratt/Desktop/Buildouts/osxdeploy2/eggs/tmprQq-MH/Cheetah-1.0-py2.4-macosx-10.3-ppc.egg

Because this distribution was installed --multi-version, before you can
import modules from this package in an application, you will need to
'import pkg_resources' and then use a 'require()' call similar to one of
these examples, in order to select the desired version:

     pkg_resources.require("Cheetah")  # latest installed version
     pkg_resources.require("Cheetah==1.0")  # this exact version
     pkg_resources.require("Cheetah>=1.0")  # this version or higher


Note also that the installation directory must be on sys.path at runtime for
this to work.  (e.g. by being the application's script directory, by 
being on
PYTHONPATH, or by being added to sys.path by your code.)

While:
   Installing interpreter.
   Getting distribution for 'Cheetah==1.0'.
Error: Couldn't install: Cheetah 1.0
[mac-pg:~/Desktop/Buildouts/osxdeploy2] davidpra%

Jim Fulton wrote:
> 
> On Dec 20, 2007, at 6:03 PM, Darryl Cousins wrote:
>> I'm trying to created an isolated environment using buildout. I had
>> understood that defining a custom build python would ensure that all
>> eggs are installed and compiled with the custom python.
>>
>> But when the buildout comes to install ZODB it is being compiled agains
>> the system python headers. (-I/usr/include/python2.4). Which is not what
>> I want, and at that point the custom python has not even been built.
>>
>> Any thoughts.
>>
>> [buildout]
>> python = custom-python
>> parts = python
>>     custom-python
>>
>>
>> [python]
>> recipe = zc.recipe.cmmi
>> url = http://www.python.org/ftp/python/2.4.4/Python-2.4.4.tar.bz2
>> extra_options = --with-threads
>>                --with-readline
>>                --enable-unicode=ucs2
>>
>> [custom-python]
>> executable = ${buildout:parts-directory}/python/bin/python
> 
> 
> Your buildout doesn't mention ZODB3 or anything that uses it, so it is 
> hard to comment.
> 
> Jim
> 
> -- 
> Jim Fulton
> Zope Corporation
> 
> 
> _______________________________________________
> Zope3-users mailing list
> Zope3-users at zope.org
> http://mail.zope.org/mailman/listinfo/zope3-users
> 


More information about the Zope3-users mailing list