[Grok-dev] "No module named shutil" error when creating new project in virutalenv

Achim Domma domma at procoders.net
Sat Nov 13 10:27:56 EST 2010


trying to use the latest grok version on Mac OS X, I get some errors. First I create a virtualenv and install grokproject like this:

virtualenv --no-site-packages testEnv
cd testEnv
source bin/activate
easy_install grokproject

That works fine so far. Then I try to create a project like this

grokproject Sample

an get the following error message:

Running /Users/domma/Develop/GrokProjects/testEnv/bin/python -S /Users/domma/Develop/GrokProjects/testEnv/Sample/bootstrap.py...
Traceback (most recent call last):
  File "/Users/domma/Develop/GrokProjects/testEnv/Sample/bootstrap.py", line 21, in <module>
    import os, shutil, sys, tempfile, textwrap, urllib, urllib2, subprocess
ImportError: No module named shutil
Running /Users/domma/Develop/GrokProjects/testEnv/Sample/bin/buildout...
/bin/sh: /Users/domma/Develop/GrokProjects/testEnv/Sample/bin/buildout: No such file or directory

If I execute python by hand, shutil is available. So I guessed that the -S flag must be related to the problem and I tried the following:

cd Sample/
python bootstrap.py

I get the following warning, but the script seems to do it's job:

/private/var/folders/Zr/Zr383cMLG1q36K2WKIjjQE+++TI/-Tmp-/tmpVzOWT0/zc.buildout-1.5.2-py2.6.egg/zc/buildout/buildout.py:303: UserWarning: Buildout has been asked to exclude or limit site-packages so that builds can be repeatable when using a system Python.  However, the chosen Python executable has a broken implementation of -S (see https://bugs.launchpad.net/virtualenv/+bug/572545 for an example problem) and this breaks buildout's ability to isolate site-packages.  If the executable already has a clean site-packages (e.g., using virtualenv's ``--no-site-packages`` option) you may be getting equivalent repeatability.  To silence this warning, use the -s argument to the buildout script.  Alternatively, use a Python executable with a working -S (such as a standard Python binary).
Creating directory '/Users/domma/Develop/GrokProjects/testEnv/Sample/bin'.
Creating directory '/Users/domma/Develop/GrokProjects/testEnv/Sample/parts'.
Creating directory '/Users/domma/Develop/GrokProjects/testEnv/Sample/develop-eggs'.
Generated script '/Users/domma/Develop/GrokProjects/testEnv/Sample/bin/buildout'.

After that I execute


and am able to start the server afterwards. So everything seems to be working now, but not as smooth as expected. Don't know if it's problem with my system or a general problem related to OS X. Any hint how to fix/debug it? Not being a Grok/Zope expert, I would feel better having a system which is known to be working correctly and as described in the documentation. ;-)


More information about the Grok-dev mailing list