How do you change Zope to run with an existing python installation instead of the one that comes packaged with the Windows distribution? Thanks.
At 19:50 26/05/99 , tgregory@rocketmail.com wrote:
How do you change Zope to run with an existing python installation instead of the one that comes packaged with the Windows distribution?
Thanks.
Just adjust the path to python in the start.bat. This will ensure that ZopeHTTPServer runs with your python. I do not know how (if at all possible) the NT Service version of Zope can be made to run with a different python. -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | Tel: +31-35-6254545 Fax: +31-35-6254555 | mailto:mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 ------------------------------------------
Unfortunately I am using Zope with IIS, not ZopeHTTPServer. My real goal here though is to get COM working with Zope. I have existing python scripts, when run with my own (not Zope's) python installation, which execute properly. Set up as external methods these scripts don't work. I thought about installing the COMObject product, but the instructions suggested the best approach to getting COM to work was to use a "real" python installation. From what I can tell there are three possible solutions: a) Setting up Zope to use my standard Python installation and IIS; b) using ZopeHTTPServer; c) modifying Zope's python installation to contain the correct COM modules. IMO: (a) is best, I could certainly live with (c), but (b) seems unacceptable for a future production environment. Any suggestions?
Just adjust the path to python in the start.bat. This will ensure that ZopeHTTPServer runs with your python.
I do not know how (if at all possible) the NT Service version of Zope can be made to run with a different python.
On Thu, 27 May 1999 15:22:01 -0000, you wrote:
Unfortunately I am using Zope with IIS, not ZopeHTTPServer. My real goal here though is to get COM working with Zope. I have existing python scripts, when run with my own (not Zope's) python installation, which execute properly. Set up as external methods these scripts don't work.
I recommend you try the same external methods under ZopeHTTPServer. If you find they work under ZopeHTTPServer but not with IIS then I may have an answer: ZopeHTTPServer is (by default) single threaded, therefore the com libraries get initialised when the pythoncom module is loaded (CoInitialize is called) and everything is happy However, the pcgi server (behind IIS) uses multiple threads. You might find that a com-using external method will work once, but only once. The second request comes in on a different thread - CoInitialise has not been called - and very little of com will work. The easiest solution for now is to call CoInitailize explicitly at the start of every external method that uses com. This ensures each thread is initialised as an STA (single threaded apartment), and the redundant calls (should you use the same external method in ZopeHTTPServer) do not cause any serious harm. Note that because you are running in an STA you must not store com object references between requests; you must recreate fresh objects each time. There was some discussion on the list recently about who should be calling CoInitialise, and what type of apartment should be created. For some future version you may need to remove all those CoInitialise calls, but everything else should 'just work'. I hope this helps. Toby Dickenson
participants (3)
-
htrd90@zepler.org -
Martijn Pieters -
tgregory@rocketmail.com