[Zope3-Users] Buildout and custom python
David Pratt
fairwinds at eastlink.ca
Fri Dec 21 13:02:43 EST 2007
Jim Fulton wrote:
>
> On Dec 20, 2007, at 8:03 PM, David Pratt wrote:
>
>> 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:
>
> Having *just* highlights makes it difficult to follow what's going on.
>
>>
>>
>> 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%
>
> That's very odd. It feels like something is missing in the output.
Hi Jim. Yeah, I know. Weird huh ... the folder was there, then
disappeared and no other clue why it bailed when finalizing. I did
buildout -vvv to give me some good verbosity for debugging also. Thing
is when run with system python, it does the right stuff. Anything more
you could suggest I check out?
I am glad I decided to stick with 10.4 for a little while longer. I am
still on a PPC platform. I have had my own trouble nasty experience with
a 10.4.9 --> 10.4.10 upgrade a couple of months ago and ended up
reinstalling the os and leaving it at 10.4.9 until I get a new machine.
Did not need the os interfering with my work. Odd for apple to have this
issue, but I was not alone at the time.
Regards,
David
>
> I tried reproducing this. I didn't have the contents of your directory,
> so I had to comment out "develop = .". You have a typo in the recipe
> specification for the python24 part. After fixing that, I ran the
> buildout above using the system Python on Mac OS X 10.5.1. Worked
> great. The interpreter script uses the custom Python.
>
> The interpreter runs, but when I try to import cheeta, I get a bus
> error.. Unfortunately, there is a problem with using cmmi to install
> Python on Mac OS X 10.5. There is a bug in Python's configure that
> causes Python to be built incorrectly. The generated pyconfig.h file
> currently requires some tweaking. :(
>
> Jim
>
> --
> Jim Fulton
> Zope Corporation
>
>
More information about the Zope3-users
mailing list