[Grok-dev] Initializing an app and module structure

Brandon Craig Rhodes brandon at rhodesmill.org
Tue Jan 20 07:59:13 EST 2009


Jeroen Michiel <jmichiel at yahoo.com> writes:

>     log.warn("unrecognized .svn/entries format in %s", dirname)
> NameError: global name 'log' is not defined

Ah, yes, the eternal setuptools problem.  It apparently neither has a
100% coverage test suite, nor was written with anything like "pyflakes"
running in the editor to catch attempts to use symbols that were not
imported.  And so it attempts to issue a log message without first
importing "log".

But the problem is trivial to fix.  The following dance has become
completely routine to me (hopefully these commands are ones you can
translate into Windows somehow?):

$ mkdir new-project-area
$ cd new-project-area
$ virtualenv v
$ v/bin/easy_install -U setuptools  # FORCES upgrade beyond broken setuptools
$ v/bin/easy_install grokproject
$ v/bin/grokproject MyGrokApp
...

I wind up with a project area with two things inside: a Grok app, and a
virtualenv that has the version of Python I'm using.

The esteemed Philipp von Weitershausen, being on a Mac, would recommend
that you run not merely "virtualenv v", but:

$ virtualenv --no-site-packages v

so that old versions of Zope packages that come installed with the
system cannot haunt you.

Good luck!

-- 
Brandon Craig Rhodes   brandon at rhodesmill.org   http://rhodesmill.org/brandon


More information about the Grok-dev mailing list