November 29, 2002
DCOracle2 on Windows
I've just installed the DCOracle2 DB-API module for Python on my laptop. It was quite a challenge. I like to think of myself as quite a savvy Python user, well installer really.
I will install at least one or two modules a month to test them out, or because I need them to perform a particular task. For my Oracle coding I have been mainly using cx_Oracle but I wanted to test some recent work against as broad a canvas as possible, hence DCOracle2.
I grabbed the .zip file from the web and unzipped it to a temporary directory. I then tried to follow the usual convention of python setup.py install but that didn't work well at all. After some mucking about and not very much help from the documentation here is how to install DCOracle2 on a Windows system (example using Python 2.2 on Windows2000);
- Download the latest zip file from the web and save to a temporary directory (in my case C:\Temp).
- Edit line 63 of the file install.py and append and not version == "2.2" to the end of the if statement.
- Start up a command line window and change directory to your temporary directory, then type python install.py (note the difference to standard distutils practice).
- You should now have a directory under your temporary directory called DCOracle2. Take this directory and copy it to your site-packages directory (on my machine this is C:\Python22\Lib\site-packages).
DCOracle2 is now installed and should be available to you.
Posted by Andy Todd at November 29, 2002 11:49 AM
THANK YOU!!!!!!
Posted by: Satish Mani on February 4, 2003 04:36 AMDude Andrew I think I am gonna feel the same as u after I am done with my installation.But do u know of any similiar site for Unix.
Thanks,
S.
After I followed the directions, I got the following error:
Type "help", "copyright", "credits" or "license" for more information.
>>> import DCOracle2
Traceback (most recent call last):
File "", line 1, in ?
File "C:\Python22\Lib\site-packages\DCOracle2\__init__.py", line 91, in ?
import DA
File "C:\Python22\Lib\site-packages\DCOracle2\DA.py", line 90, in ?
from db import DB
File "C:\Python22\Lib\site-packages\DCOracle2\db.py", line 89, in ?
import DCOracle2, DateTime
ImportError: No module named DateTime
George, I'm not sure what exactly is causing your problem, but the module that is raising the exception is the Zope adapter. This sits on top of DCOracle2 and makes it available to for use as a Zope database adapter. The DateTime class is part of Zope, which is why it can be imported by db.py. If you want to install the Zope adapter follow the instructions on the DCOracle2 home page (http://www.zope.org/Members/matt/dco2).
You don't need the offending file to talk to Oracle from a *standard* Python installation. The only files you should have in the DCOracle2 directory are;
__init__.py
dco2.pyd (or equivalent)
DCOracle2.py
version.py