[Zope] Re: pythonpath incomplete?

Thomas Schorr t_schorr at gmx.de
Fri Nov 5 03:12:47 EST 2004


On Thursday 04 November 2004 20:44, Wouter Vanden Hove wrote:
> Thomas Schorr wrote:
> > * on the python prompt, enter:
> >>>> import sys
> >>>> sys.path
> >
> > you should find difflib.py in one of the directories listed here. Or try
> >
> > to import difflib from here:
> >>>> import difflib
> >
> > What happens?
>
> the error is get is
>  File "/opt/Zope-2.7.3-0/lib/python/OFS/History.py", line 20, in ?
>     import Globals, ExtensionClass, difflib
>
> so before the import statemens I added
> import sys
> sys.path
> to this the /opt/Zope-2.7.3-0/lib/python/OFS/History.py
>
>
>
> [root at minfpc26 Zope-2.7.3-0]# ./bin/runzope
> ------
> ...
> 2004-11-04T20:10:19 INFO(0) Zope Set effective user to "apache"
> ['/opt/Zope-2.7.3-0/lib/python', '/opt/Zope-2.7.3-0/lib/python',
> '/opt/Zope-2.7.3-0/lib/python/Zope/Startup', '/usr/local/lib/python2.3',
> '/opt/Zope-2.7.3-0/lib/python', '/usr/local/lib/python23.zip',
> '/usr/local/lib/python2.3/plat-linux2', '/usr/local/lib/python2.3/lib-tk',
> '/usr/local/lib/python2.3/lib-dynload',
> '/usr/local/lib/python2.3/site-packages',
> '/usr/local/lib/python2.3/site-packages/PIL']
> Traceback (most recent call last):
...
>     import Globals, ExtensionClass, difflib
> ImportError: No module named difflib
>
>
> so /usr/local/lib/python2.3
> is indeed in the pythonpath
>
> difflib.py is in directory  /usr/local/lib/python2.3
>
> Then what goes wrong?
>
>
> w.
>
>
>
>
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )

Hi again,

I still think it might have to do with the permissions. It seems you don't use 
low ports, so why don't you follow the standard way:

* create a user account dedicated only to zope
* login as that user
* start zope

If this still doesn't work, try adding this user to the root group (usermod -G 
root your_username) and try again. I had import errors (although different 
ones) after installing a Zope 2.7.2 as root on a development machine and then 
trying to start it from a user account that only belonged to the "users" 
group. After adding this user to the "root" group, everything worked fine. 
Indeed from the Zope 2.7 Book, one can guess that Zope should probably not be 
installed as root (?). So you could also try a "chown  -R 
your_username:users /opt/Zope-2.7.3-0" without adding the user to the root 
group. Perhaps you might then have to check the permissions for the database 
files.

Regards Thomas


More information about the Zope mailing list