I would like to do some Zope product development outside of the main Zope environment and need to set my PYTHONPATH correctly to pull in all the right modules. I have Zope installed at "/zope" and my path is currently: PYTHONPATH=zope/lib/python:zope/bin/lib: When I attempt to compile the line "from Interface import Base" I get an error that the module does not exist. I am following a tutorial in the zope developers guide... I have also tried importing other modules to no avail. Any ideas? Thanks.
[Kevin Carlson]
I would like to do some Zope product development outside of the main Zope environment and need to set my PYTHONPATH correctly to pull in all the right modules. I have Zope installed at "/zope" and my path is currently:
PYTHONPATH=zope/lib/python:zope/bin/lib:
When I attempt to compile the line "from Interface import Base" I get an error that the module does not exist. I am following a tutorial in the zope developers guide...
PYTHONPATH=/zope/lib/python:/zope/bin/lib: Tom P
My bad, Thomas. That's actually what I have in the PYTHONPATH...any other ideas? -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Thomas B. Passin Sent: Monday, March 18, 2002 6:34 PM To: zope@zope.org Subject: Re: [Zope] PYTHONPATH [Kevin Carlson]
I would like to do some Zope product development outside of the main Zope environment and need to set my PYTHONPATH correctly to pull in all the right modules. I have Zope installed at "/zope" and my path is currently:
PYTHONPATH=zope/lib/python:zope/bin/lib:
When I attempt to compile the line "from Interface import Base" I get an error that the module does not exist. I am following a tutorial in the zope developers guide...
PYTHONPATH=/zope/lib/python:/zope/bin/lib: Tom P _______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Maybe the document is not correct for your version of Python/Zope? I also get the error, this is what I see: Zope 2.5, Python 2.1.2 #31 $ find . -name 'Interface*' ./lib/python/BTrees/Interfaces.py ./lib/python/BTrees/Interfaces.pyc ./lib/python/Interface ./lib/python/Interface/InterfaceBase.py ./lib/python/Interface/InterfaceBase.pyc ./lib/python/Products/MetaPublisher/help/Interfaces.stx ./lib/python/Products/MetaPublisher/Interface.py ./lib/python/Products/MetaPublisher/Interface.pyc $ python Python 2.1.2 (#31, Jan 15 2002, 17:28:11) [MSC 32 bit (Intel)] on win32 Type "copyright", "credits" or "license" for more information.
from Interface import Base Traceback (most recent call last): File "<stdin>", line 1, in ? ImportError: No module named Interface ^Z
$ echo $PYTHONPATH | sed 's/;/;\ /g' C:\Program Files\Website\bin\DLLs; C:\Program Files\Website\bin\lib; C:\Program Files\Website\bin\lib\plat-win; C:\Program Files\Website\bin\lib\lib-tk; C:\Program Files\Website\bin $ pwd /cygdrive/c/program files/website ...on Windows 2000. -Rob ----- Original Message ----- From: "Kevin Carlson" <khcarlso@bellsouth.net> To: "Thomas B. Passin" <tpassin@mitretek.org> Cc: <zope@zope.org> Sent: Monday, March 18, 2002 6:39 PM Subject: RE: [Zope] PYTHONPATH
My bad, Thomas. That's actually what I have in the PYTHONPATH...any other ideas?
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Thomas B. Passin Sent: Monday, March 18, 2002 6:34 PM To: zope@zope.org Subject: Re: [Zope] PYTHONPATH
[Kevin Carlson]
I would like to do some Zope product development outside of the main Zope environment and need to set my PYTHONPATH correctly to pull in all the right modules. I have Zope installed at "/zope" and my path is currently:
PYTHONPATH=zope/lib/python:zope/bin/lib:
When I attempt to compile the line "from Interface import Base" I get an error that the module does not exist. I am following a tutorial in the zope developers guide...
PYTHONPATH=/zope/lib/python:/zope/bin/lib:
Tom P
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
_________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
[Kevin Carlson]
My bad, Thomas. That's actually what I have in the PYTHONPATH...any other ideas?
Here's what I would do. In Zope, create an external method that reports the system path: import sys def getpath(): return sys.path Display the results in a dtml page that calls the external method. Now you know exactly what path Zope is using. Next, launch Python as you intend to for your out-of-Zope development. Get sys.path and see if any directories are missing. Set PYTHONPATH to add them. If you are using Zope's Python, set the PYTHONPATH before launching Python. I don't know if Python as used by Zope needs to find anything in relative paths or not, but that should be handled by cd-ing to the Zope startup directory before launching Python. Cheers, Tom P
participants (3)
-
Kevin Carlson -
Rob Lemley -
Thomas B. Passin