Hi, I have python 2.3.4 running on my server and I installed Zope 2.7.3. installation goes wel, but when starting zope, I get: 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 difflib is installed in /usr/local/lib/python2.3/difflib.py so it seems zope can't see the normal python-libraries. How to solve this? I installed Zope 2.7.3 because my normal zope (2.7.2) stopped functioning (cause unknown) with exactly the same kind of import-errors. It ran without any problems before. thx, w.
On Thu, 2004-11-04 at 14:19, Wouter Vanden Hove wrote:
Hi, I have python 2.3.4 running on my server and I installed Zope 2.7.3. installation goes wel, but when starting zope, I get:
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 difflib is installed in /usr/local/lib/python2.3/difflib.py
so it seems zope can't see the normal python-libraries. How to solve this?
compare: which python2.3 output with what you have to start zope. Use full path here if in doubt best as option to ./configure --with-python=python2.3 or so. see ls -l /usr/local/lib/python2.3/difflib.py and look for permissions and filesize then try: python2.3 -v
import difflib
whatch output (after start and after import difflib) Regards Tino
Tino Wildenhain wrote:
compare: which python2.3 output with what you have to start zope. Use full path here if in doubt best as option to ./configure --with-python=python2.3 or so.
[bin]# which python2.3 /usr/local/bin/python2.3 [bin]# cat runzope #! /bin/sh PYTHON="/usr/local/bin/python2.3" ZOPE_HOME="/opt/Zope-2.7.3-0" INSTANCE_HOME="/opt/Zope-2.7.3-0" CONFIG_FILE="/opt/Zope-2.7.3-0/etc/zope.conf" SOFTWARE_HOME="/opt/Zope-2.7.3-0/lib/python" PYTHONPATH="$SOFTWARE_HOME" export PYTHONPATH INSTANCE_HOME SOFTWARE_HOME ZOPE_RUN="$SOFTWARE_HOME/Zope/Startup/run.py" exec "$PYTHON" "$ZOPE_RUN" -C "$CONFIG_FILE" "$@"
see ls -l /usr/local/lib/python2.3/difflib.py and look for permissions and filesize
[root@minfpc26 Zope-2.7.3-0]# ls -l /usr/local/lib/python2.3/difflib.py -rw-r--r-- 1 root root 49736 Aug 9 00:21 /usr/local/lib/python2.3/difflib.py Seems ok.
then try: python2.3 -v
import difflib
whatch output (after start and after import difflib)
import difflib # /usr/local/lib/python2.3/difflib.pyc matches /usr/local/lib/python2.3/difflib.py import difflib # precompiled from /usr/local/lib/python2.3/difflib.pyc # /usr/local/lib/python2.3/re.pyc matches /usr/local/lib/python2.3/re.py import re # precompiled from /usr/local/lib/python2.3/re.pyc # /usr/local/lib/python2.3/sre.pyc matches /usr/local/lib/python2.3/sre.py import sre # precompiled from /usr/local/lib/python2.3/sre.pyc # /usr/local/lib/python2.3/sre_compile.pyc matches /usr/local/lib/python2.3/sre_compile.py import sre_compile # precompiled from /usr/local/lib/python2.3/sre_compile.pyc import _sre # builtin # /usr/local/lib/python2.3/sre_constants.pyc matches /usr/local/lib/python2.3/sre_constants.py import sre_constants # precompiled from /usr/local/lib/python2.3/sre_constants.pyc # /usr/local/lib/python2.3/sre_parse.pyc matches /usr/local/lib/python2.3/sre_parse.py import sre_parse # precompiled from /usr/local/lib/python2.3/sre_parse.pyc # /usr/local/lib/python2.3/string.pyc matches /usr/local/lib/python2.3/string.py import string # precompiled from /usr/local/lib/python2.3/string.pyc dlopen("/usr/local/lib/python2.3/lib-dynload/strop.so", 2); import strop # dynamically loaded from /usr/local/lib/python2.3/lib-dynload/strop.so
import works just fine. w.
Hi, I have python 2.3.4 running on my server and I installed Zope 2.7.3. installation goes wel, but when starting zope, I get:
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 difflib is installed in /usr/local/lib/python2.3/difflib.py
so it seems zope can't see the normal python-libraries. How to solve this?
I installed Zope 2.7.3 because my normal zope (2.7.2) stopped functioning (cause unknown) with exactly the same kind of import-errors. It ran without any problems before.
thx, w.
_______________________________________________ Zope maillist - Zope@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, 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) * 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? Regards, Thomas
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@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.
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@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@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
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@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): File "/opt/Zope-2.7.3-0/lib/python/Zope/Startup/run.py", line 50, in ? run() File "/opt/Zope-2.7.3-0/lib/python/Zope/Startup/run.py", line 19, in run start_zope(opts.configroot) File "/opt/Zope-2.7.3-0/lib/python/Zope/Startup/__init__.py", line 51, in start_zope starter.startZope() File "/opt/Zope-2.7.3-0/lib/python/Zope/Startup/__init__.py", line 230, in startZope Zope.startup() File "/opt/Zope-2.7.3-0/lib/python/Zope/__init__.py", line 46, in startup from Zope.App.startup import startup as _startup File "/opt/Zope-2.7.3-0/lib/python/Zope/App/startup.py", line 30, in ? import OFS.Application File "/opt/Zope-2.7.3-0/lib/python/OFS/Application.py", line 17, in ? import Globals,Folder,os,sys,App.Product, App.ProductRegistry, misc_ File "/opt/Zope-2.7.3-0/lib/python/App/Product.py", line 42, in ? import ZClasses, AccessControl.Owned File "/opt/Zope-2.7.3-0/lib/python/ZClasses/__init__.py", line 20, in ? import ZClass File "/opt/Zope-2.7.3-0/lib/python/ZClasses/ZClass.py", line 16, in ? import Method, Basic, Property, AccessControl.Role, re File "/opt/Zope-2.7.3-0/lib/python/ZClasses/Method.py", line 23, in ? from OFS.DTMLMethod import DTMLMethod File "/opt/Zope-2.7.3-0/lib/python/OFS/DTMLMethod.py", line 17, in ? import History File "/opt/Zope-2.7.3-0/lib/python/OFS/History.py", line 20, in ? 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.
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@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@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
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@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): File "/opt/Zope-2.7.3-0/lib/python/Zope/Startup/run.py", line 50, in ? run() File "/opt/Zope-2.7.3-0/lib/python/Zope/Startup/run.py", line 19, in run start_zope(opts.configroot) File "/opt/Zope-2.7.3-0/lib/python/Zope/Startup/__init__.py", line 51, in start_zope starter.startZope() File "/opt/Zope-2.7.3-0/lib/python/Zope/Startup/__init__.py", line 230, in startZope Zope.startup() File "/opt/Zope-2.7.3-0/lib/python/Zope/__init__.py", line 46, in startup from Zope.App.startup import startup as _startup File "/opt/Zope-2.7.3-0/lib/python/Zope/App/startup.py", line 30, in ? import OFS.Application File "/opt/Zope-2.7.3-0/lib/python/OFS/Application.py", line 17, in ? import Globals,Folder,os,sys,App.Product, App.ProductRegistry, misc_ File "/opt/Zope-2.7.3-0/lib/python/App/Product.py", line 42, in ? import ZClasses, AccessControl.Owned File "/opt/Zope-2.7.3-0/lib/python/ZClasses/__init__.py", line 20, in ? import ZClass File "/opt/Zope-2.7.3-0/lib/python/ZClasses/ZClass.py", line 16, in ? import Method, Basic, Property, AccessControl.Role, re File "/opt/Zope-2.7.3-0/lib/python/ZClasses/Method.py", line 23, in ? from OFS.DTMLMethod import DTMLMethod File "/opt/Zope-2.7.3-0/lib/python/OFS/DTMLMethod.py", line 17, in ? import History File "/opt/Zope-2.7.3-0/lib/python/OFS/History.py", line 20, in ? 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.
I don't know if this can be the case, but since difflib is the last import on the line, can it be that there is some spurious character at the end? Try opening it with vi with a -b option, and check it. Or open it without the -b option, and watch if on the last line there is a [dos] label. Also, try to rewrite the line from scratch. Regards Marco
participants (4)
-
Marco Bizzarri -
Thomas Schorr -
Tino Wildenhain -
Wouter Vanden Hove