[Zope] Re: pythonpath incomplete?

Thomas Schorr t_schorr at gmx.de
Thu Nov 4 10:53:04 EST 2004


On Thursday 04 November 2004 16:38, Wouter Vanden Hove wrote:
> Thomas Schorr wrote:
> > Hi Wouter,
> > did you actually check the pythonpath?
> >
> > * start python (the one that is used by your zope installation, i.e. is
> > referred to by the line PYTHON= in your
> > /path_to_zope_instance/bin/runzope script)
>
> runzope refers to PYTHON="/usr/local/bin/python2.3"
>
> > * 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?
>
> [root at minfpc26 bin]# /usr/local/bin/python2.3
> Python 2.3.4 (#1, Aug  9 2004, 00:14:18)
> [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>
> >>> import sys
> >>> sys.path
>
> ['', '/usr/local/lib/python23.zip', '/usr/local/lib/python2.3',
> '/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']
>
> >>> import difflib
>
> This all seems to work fine.
> But when I start this instance:
>
> [root@*** bin]# ./runzope
> ------
> 2004-11-04T16:29:27 INFO(0) ZServer HTTP server started at Thu Nov  4
> 16:29:27 2004
>         Hostname: ***
>         Port: 8080
> ------
> 2004-11-04T16:29:27 INFO(0) ZServer FTP server started at Thu Nov  4
> 16:29:27 2004
>         Hostname: ***
>         Port: 8021
> ------
> 2004-11-04T16:29:27 INFO(0) ZServer HTTP server started at Thu Nov  4
> 16:29:27 2004
>         Hostname:***
>         Port: 8031
> ------
> 2004-11-04T16:29:27 INFO(0) Zope Set effective user to "apache"
> Traceback (most recent call last):
>   File "/opt/Zope-2.7/lib/python/Zope/Startup/run.py", line 50, in ?
>     run()
>   File "/opt/Zope-2.7/lib/python/Zope/Startup/run.py", line 19, in run
>     start_zope(opts.configroot)
>   File "/opt/Zope-2.7/lib/python/Zope/Startup/__init__.py", line 51, in
> start_zope
>     starter.startZope()
>   File "/opt/Zope-2.7/lib/python/Zope/Startup/__init__.py", line 230, in
> startZope
>     Zope.startup()
>   File "/opt/Zope-2.7/lib/python/Zope/__init__.py", line 46, in startup
>     from Zope.App.startup import startup as _startup
>   File "/opt/Zope-2.7/lib/python/Zope/App/startup.py", line 30, in ?
>     import OFS.Application
>   File "/opt/Zope-2.7/lib/python/OFS/Application.py", line 17, in ?
>     import Globals,Folder,os,sys,App.Product, App.ProductRegistry, misc_
>   File "/opt/Zope-2.7/lib/python/App/Product.py", line 44, in ?
>     from HelpSys.HelpSys import ProductHelp
>   File "/opt/Zope-2.7/lib/python/HelpSys/__init__.py", line 15, in ?
>     import HelpSys
>   File "/opt/Zope-2.7/lib/python/HelpSys/HelpSys.py", line 18, in ?
>     from Products.ZCatalog.ZCatalog import ZCatalog
>   File "/opt/Zope-2.7/lib/python/Products/ZCatalog/__init__.py", line 16,
> in ?
>     import ZCatalog, Catalog, CatalogAwareness, CatalogPathAwareness,
> ZClasses
>   File "/opt/Zope-2.7/lib/python/Products/ZCatalog/ZCatalog.py", line 33,
> in ?
>     from ZCatalogIndexes import ZCatalogIndexes
>   File "/opt/Zope-2.7/lib/python/Products/ZCatalog/ZCatalogIndexes.py",
> line 32, in ?
>     from Products.PluginIndexes.common.PluggableIndex import
> PluggableIndexInterface
>   File "/opt/Zope-2.7/lib/python/Products/PluginIndexes/__init__.py", line
> 23, in ?
>     import DateIndex.DateIndex
>   File
> "/opt/Zope-2.7/lib/python/Products/PluginIndexes/DateIndex/DateIndex.py",
> line 17, in ?
>     from datetime import tzinfo, timedelta
> ImportError: No module named datetime
>
>
>
>
> I now get a datetime error because I
> copied /usr/local/lib/python2.3/difflib.py to
> /opt/Zope-2.7.3-0/lib/python/OFS/
> because I got:
>
>   File "/opt/Zope-2.7.3-0/lib/python/OFS/History.py", line 17, in ?
>     import Globals, ExtensionClass, difflib
> ImportError: No module named difflib
>
> but manually copying every called python-file to the zope-dir doesn't make
> any sense as a solution.
>
> This seems a problem with the PYTHONPATH,
> but after checking everything seems ok with that.
>
> Now my zope-server is still down including the mailinglists I transferred
> to mailboxer two weeks ago.   :(
>
>
> 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 Wouter,

just guessing, but did you ever try with another user, not apache? You can 
control this with the effective-user directive in the zope.conf file.

Regards Thomas



More information about the Zope mailing list