Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Installation problems DCOracle2 & W2000

0 views
Skip to first unread message

Talon

unread,
Jun 25, 2002, 10:34:54 PM6/25/02
to
Hi all,

I am having a heck of a time getting DCOracle2 to funcion properly. I
am running on a W2K machine, python2.1.3 and Zope 2.5.1, both of which
run just fine. I installed DCOracle2 and the ZOracleDA under Zope and
it works fine. But standalone python scripts don't see the dco2.py
module. So I tried to install DCOracle2 in the python21/lib folder. I
got that latest version from Zope.org and it said it installed properly.
But it doesn't run. If you try to import it into a script, you get
complaints that it can't find this or that module, all of which are part
of the Zope path.

I tried the odbc package, and it works for SELECT's but has a problem
with INSERT's. I downloaded the mxODBC package, but haven't tried it
yet and I've read about the cxOracle module. Does anyone have any
advice? The docs for Windows install of DCOracle2 are really poor and
inconsistent. I would like to stay with DCOracle2 if possible, since
that is what is running on Zope, but I will consider anything that works.

TIA,

Mark

Fazal Majid

unread,
Jun 25, 2002, 11:28:17 PM6/25/02
to
Talon wrote:
> I am having a heck of a time getting DCOracle2 to funcion properly. I
> am running on a W2K machine, python2.1.3 and Zope 2.5.1, both of which
> run just fine. I installed DCOracle2 and the ZOracleDA under Zope and
> it works fine. But standalone python scripts don't see the dco2.py
> module. So I tried to install DCOracle2 in the python21/lib folder. I
> got that latest version from Zope.org and it said it installed properly.
> But it doesn't run. If you try to import it into a script, you get
> complaints that it can't find this or that module, all of which are part
> of the Zope path.

I have gotten DCOracle2 to work correctly on my Windows 2000 setup with
2.1.1 (but I haven't tried it with Zope). You do need to set your
Pythonpath environment variable correctly, as well as copy the correct
dco2.pyd (DLL) version for your Python and Oracle versions.

-- Fazal Majid

If you want to respond by email, take the nospam out of my email address.

Talon

unread,
Jun 26, 2002, 10:49:34 AM6/26/02
to
In article <3D1934D1...@nospam.majid.fm>,
Fazal Majid <ne...@nospam.majid.fm> wrote:

Thanks for the response Fazal. I believe the python path is correct, as
other python scripts run fine. The dco2.pyd file is copied to the
correct directory by the latest version of install.py that comes with
it. But when a script tries to import DCOracle2, I get an error saying
it is looking for Buffer or DateTime, all of which are part of the Zope
path.

Mark

bru...@tbye.com

unread,
Jun 26, 2002, 11:17:41 AM6/26/02
to
On Wed, 26 Jun 2002, Talon wrote:

> I am having a heck of a time getting DCOracle2 to funcion properly. I
> am running on a W2K machine, python2.1.3 and Zope 2.5.1, both of which
> run just fine. I installed DCOracle2 and the ZOracleDA under Zope and
> it works fine. But standalone python scripts don't see the dco2.py
> module. So I tried to install DCOracle2 in the python21/lib folder. I
> got that latest version from Zope.org and it said it installed properly.
> But it doesn't run. If you try to import it into a script, you get
> complaints that it can't find this or that module, all of which are part
> of the Zope path.

Hi Talon,

Some of our development machines use the same configuration you list
above. You're probably _very_ close, so I'd stick with DCOracle2 if you
can. Would you mind posting the specific error messages you're getting?
Also, you mentioned that standalone scripts don't work, but just to be
clear, using DCOracle2 in Zope _does_ work without problems? (your
connection object is open, you can browse the database, you can run test
queries, ZSQL methods, etc.)

If it's working for Zope, then standalone scripts should be able to use
DCO2 if you include the right directory in your PYTHONPATH environment
variable, so please tell us what your PYTHONPATH is too.

Good luck,
Dave

Talon

unread,
Jun 26, 2002, 1:30:31 PM6/26/02
to
In article <mailman.1025101359...@python.org>,
bru...@tbye.com wrote:

Hi Dave,

OK, here you go:

Path = C:\Python21\; (I don't have a specific PYTHONPATH variable set.
This is in the general PATH variable)

The error I get is

File "C:\Python21\myfiles\htsa_data_loader_v2.py", line 9, in ?
import os,sys,re,string,DCOracle2
File "C:\Python21\DCOracle2\__init__.py", line 91, in ?
import DA
File "C:\Python21\DCOracle2\DA.py", line 90, in ?
from db import DB
File "C:\Python21\DCOracle2\db.py", line 89, in ?
import DCOracle2, DateTime
ImportError: No module named DateTime

DateTime is located in C:\Program Files\ZopeDev\lib\python\DateTime

are you suggesting that I put the Zope path into the PATH variable as
well? DCOracle2 DOES work in Zope, I can do all the things you listed,
I have DTML that queries a db and returns the data.

By the way, I got things to work well with cx_Oracle this morning, so I
do have another option, but I'm very interested in solving this problem.

Thanks for your assistance.

Mark

bru...@tbye.com

unread,
Jun 26, 2002, 3:18:21 PM6/26/02
to
On Wed, 26 Jun 2002, Talon wrote:

> OK, here you go:
>
> Path = C:\Python21\; (I don't have a specific PYTHONPATH variable set.
> This is in the general PATH variable)
>
> The error I get is
>
> File "C:\Python21\myfiles\htsa_data_loader_v2.py", line 9, in ?
> import os,sys,re,string,DCOracle2
> File "C:\Python21\DCOracle2\__init__.py", line 91, in ?
> import DA
> File "C:\Python21\DCOracle2\DA.py", line 90, in ?
> from db import DB
> File "C:\Python21\DCOracle2\db.py", line 89, in ?
> import DCOracle2, DateTime
> ImportError: No module named DateTime
>
> DateTime is located in C:\Program Files\ZopeDev\lib\python\DateTime

Aha! Here's what I think the problem is: the DCOracle2 bundle off the Zope
site comes all wrapped up in the Zope database adapter (ZOracleDA), so
your above script is actually trying to import the DA and not the
DCOracle2 package itself (I can see why this is confusing - both
directories are named DCOracle2 but one is a subdirectory of the other!).

So... if you look in c:\python21\DCOracle2 you should find a subdirectory
in there also called DCOracle2. This is the only one you should need for
doing standalone (none-Zope) work with Oracle. The easiest thing to do is
rename c:\python21\DCOracle2 to DCOracle2bak or something, and then move
its DCOracle2 subdirectory into c:\python21 and then try your script
again.

Does this make sense? Please let me know if it doesn't or if it still
doesn't work after that.

-Dave

Fazal Majid

unread,
Jun 26, 2002, 8:32:43 PM6/26/02
to
bru...@tbye.com wrote:
> Aha! Here's what I think the problem is: the DCOracle2 bundle off the Zope
> site comes all wrapped up in the Zope database adapter (ZOracleDA), so
> your above script is actually trying to import the DA and not the
> DCOracle2 package itself (I can see why this is confusing - both
> directories are named DCOracle2 but one is a subdirectory of the other!).

I just reinstalled Oracle 9.2.0.1 + Python 2.2 + DCOracle2 on a new
computer so I can reproduce the steps to a correct install. I think Dave
is right on track here, there is a name conflict between the module
DCOracle2.py, which is standalone without Zope and that you want to use,
and DCOracle2 the Zope database adapter package directory which is used
only from within Zope.

Here is my setup:

PYTHONPATH=D:\Etc\DCOracle2

D:\Etc\DCOracle2>python
Python 2.2.1 (#34, Apr 9 2002, 19:34:33) [MSC 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import DCOracle2
>>> d=DCOracle2.connect('scott/tiger@database')
>>> d.execute('select SYSDATE from dual')
1
>>> d.fetchall()
[[OracleDate("2002-06-26 17:31:57")]]
>>> ^Z
D:\Etc\DCOracle2>dir
Volume in drive D is MAJID
Volume Serial Number is B8C2-4135

Directory of D:\Etc\DCOracle2

2002-06-11 14:47 <DIR> .
2002-06-11 14:47 <DIR> ..
2002-06-05 15:00 73,728 dco2.pyd
2002-06-05 12:16 56,957 DCOracle2.py
2002-06-05 15:00 180,304 win32-python-1.5.2-805-dco2.pyd
2002-06-05 15:00 73,728 win32-python-1.5.2-dco2.pyd
2002-06-05 15:00 180,298 win32-python-2.1-805-dco2.pyd
2002-06-05 15:00 73,728 win32-python-2.1-dco2.pyd
2002-06-05 15:00 73,728 win32-python-2.2-dco2.pyd
2002-06-05 12:16 1,725 __init__.py
2002-06-26 17:21 46,293 DCOracle2.pyc
9 File(s) 760,489 bytes
2 Dir(s) 6,778,052,608 bytes free

Talon

unread,
Jun 26, 2002, 11:36:08 PM6/26/02
to
In article <mailman.1025115815...@python.org>,
bru...@tbye.com wrote:

Dave,
That was dead on. I did as you said and now it works perfectly. I
thought I had done this originally, but I guess I had moved the outer
folder instead. Thank you very much. Thanks to Fazal also for his
input. It is much appreciated.

Mark

0 new messages