[Grok-dev] Re: First Experience with Grok
Philipp von Weitershausen
philipp at weitershausen.de
Sun Sep 16 09:37:56 EDT 2007
Martijn Faassen wrote:
>> I'd like to point out one issue I stumbled on at first. After running
>> grokproject, the server would not start. The exception I got was
>> cryptic. After studying it, I realized my system had an older version
>> of zope.interface and Twisted installed in site-packages, and that the
>> sys.path constructed by grokproject preferred the version in
>> site-packages. I fixed the problem by removing my site-packages path
>> from the generated runzope. I suspect site-packages should never be
>> preferred over anything from the buildout-eggs directory.
Indeed. My suspicion is that Shane's running Ubuntu or Debian. Because
those and other distributions install certain packages as development
eggs into lib/python2.x/site-packages. I wish they wouldn't do that. For
the problem is that buildout (through setuptools) will find them as
regular eggs and put their "location" (which is site-packages) on
sys.path. That's why Shane is getting site-packages *before* other eggs
on sys.path.
> Unfortunately this problem occurs frequently. Many people also have Zope
> 3 installed in their site packages, which leads to similar problems.
Those similar problems (No such module "schemaless") is actually a bug
in zc.buildout: https://bugs.launchpad.net/zc.buildout/+bug/133462
> One way around this is to use an installation procedure in grokproject
> that sets up a virtual Python environment. Ignas has contributed some
> work in that direction.
Only problem with virtual-python (an the new virtualenv) is that they
only work on Unix because they need symlinks.
> JW pointed the following out to me the other day, though: isolating
> Grok's python from the system Python might make life harder for
> beginners. If they install some useful Python package using easy_install
> or, say, the Ubuntu package manager, they would expect it to be
> available in their grok application and might be surprised if it's not.
> The proper way to add dependencies would be to modify setup.py and/or
> the buildout.cfg, but we may not want to confront beginners with a new
> world of dependency management right away as well.
>
> Perhaps we can resolve this by giving grokproject an option. By default,
> it doesn't set up a virtual Python. However, if a certain option is
> used, we do. We put in the instructions that if they have problems
> installing or using Grok, they could try grokproject with the latter
> option (and spell out the causes and consequences).
I think zc.buildout should gain such a feature proper: simply ignore
anything installed anywhere other than your own eggs directory.
--
http://worldcookery.com -- Professional Zope documentation and training
More information about the Grok-dev
mailing list