473,385 Members | 1,640 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Trying to install cx_Oracle

I'm new to Python and would like to learn it but also want to use cx_Oracle to access Oracle. I've installed 2 versions of Python and on the latest version (3.1.2) I get the error

File "<stdin>", line 1
install cx_Oracle
^
SyntaxError: invalid syntax

Please Help
I've put the cx_Oracle in the local dirctory and the path to it in the path. I'm using windows
Jul 15 '10 #1
21 9283
bvdet
2,851 Expert Mod 2GB
If you did a binary installation, all you need to do is import the module as in:
Expand|Select|Wrap|Line Numbers
  1. import cx_Oracle
Jul 15 '10 #2
Thanks but thats what I do and then I get the error
Jul 15 '10 #3
bvdet
2,851 Expert Mod 2GB
I could be something as simple as a leading space character as in:
Expand|Select|Wrap|Line Numbers
  1. >>>  import math
  2. Traceback (  File "<interactive input>", line 1
  3.     import math
  4.     ^
  5. SyntaxError: invalid syntax
  6. >>> 
Jul 15 '10 #4
Unfortunately not, I've tried extra spaces, upper case, lower case, the case that is specified...... AAAAAggggh
Jul 15 '10 #5
bvdet
2,851 Expert Mod 2GB
It's probably something in the preceding code, possibly unbalanced parentheses.
Jul 15 '10 #6
but I'm only putting in import cx_Oracle
Jul 15 '10 #7
bvdet
2,851 Expert Mod 2GB
@Paulmiddleton
Does this work:
Expand|Select|Wrap|Line Numbers
  1. import math
Jul 15 '10 #8
That worked, just went straight back to the prompt
Jul 16 '10 #9
>>> import cx_Oracle
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: DLL load failed: The specified module could not be found.
Jul 16 '10 #10
bvdet
2,851 Expert Mod 2GB
Make sure the pyd file is in a directory on the Python path as in:
Expand|Select|Wrap|Line Numbers
  1. >>> import sys
  2. >>> sys.path
Jul 16 '10 #11
This is the results of the above, I've put the cx_Oracle.pyd file in every directory here but still get the asme error. How do I add a directory to sys??

['', 'C:\\Python31\\python31.zip', 'C:\\Python31\\DLLs', 'C:\\Python31\\lib', 'C:\\Python31\\lib\\pl
at-win', 'C:\\Python31', 'C:\\Python31\\lib\\site-packages']

Error Message


>>> import cx_Oracle
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: DLL load failed: The specified module could not be found.
Jul 16 '10 #12
bvdet
2,851 Expert Mod 2GB
@Paulmiddleton
Did you perform a binary installation? The install file should have a name like cx_Oracle-5.0.3-10g.win32-py2.6.msi.
Jul 16 '10 #13
Yes,the install file is
cx_Oracle-5.0-10g.win32-py3.0.msi
Jul 16 '10 #14
bvdet
2,851 Expert Mod 2GB
Try installing the version that matches your Python version:
cx_Oracle-5.0.3-10g.win32-py3.1.msi
Jul 16 '10 #15
I've now installed that version and I still get the same error. How does it know about the directory its installed in? or what directory should I put the file in?
Jul 16 '10 #16
bvdet
2,851 Expert Mod 2GB
I have never installed this module. Typically installs such as this look for a Python installation in your registry and will put the required files in a folder under lib/site-packages. For example, on my system PIL was installed in 'C:\\Python23\\lib\\site-packages\\PIL' and that folder was added to the Python path.
Jul 16 '10 #17
ah well, thanks for your help, I'm loosing the will to live.
with python31, I've just tried print "Hello" and got the following message
File "<stdin>", line 1
print "Hello"
^
SyntaxError: invalid syntax

but it is ok when I do it in python24
Jul 16 '10 #18
I have just re-installed python31 and still get an error when trying to print. 2+3 is ok but not print
Jul 16 '10 #19
bvdet
2,851 Expert Mod 2GB
I wish I could be more help. I'm still in Python 2.3 because that's the version embedded in the software I use in my work.
Jul 16 '10 #20
Yeah, that seems to work but I still get an error message when I do import cx_Oracle.

It maybe because I don't have any sys admin rights on this dammed PC. I'm going to give up. Thanks anyway for trying
Jul 16 '10 #21
Paul,
I am having the same install problems with cx_Oracle but I have figured out the print issues. If you want to print hello in Python 3.1 you have to write the following:
print('hello')

that should work.

Michelle
Aug 13 '10 #22

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: GrayGeek | last post by:
After cx_Oracle and the related Oracle tools for Python 2.2.3 + Boa-constructor on Win2000, I added "import cx_Oracle" to the top of a test script. It gives me an error about being unable to find...
8
by: Rodrigo Daunaravicius | last post by:
I can't get this configuration working: cx_Oracle 4.0.1 Oracle 8.0.6 Python 2.3.3 Win NT4.0 SP6fc My first shot at the problem was just running the installation thingie pre-built for...
1
by: Thiago | last post by:
Hi guy, I'm trying install the MySQLdb and i'm receiving the message when i execute the command python setup.py install: error: Python was built with version 6 of Visual Studio, and extensions...
1
by: jmdeschamps | last post by:
Hello Having cx_Oracle (an Oracle database connector for Python) used it here where I teach for the last couple of years, and finding it so easy to use (and install) I was taken aback when I got...
5
by: Daniel | last post by:
Hello from Brazil :-) I'm trying to bring cx_Oracle alive on my Python 2.4.1 @ HP-UX 11 (suckz) and Oracle 10.1.0 64bits without success I've already tryied the suggestions from Bernard Delmée...
0
by: Brian Cole | last post by:
I can compile and install cx_Oracle fine by following the manta: export ORACLE_HOME=... python setup.py install export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH python >>> import...
1
by: lblr33 | last post by:
I downloaded cx_Oracle from http://www.cxtools.net/default.aspx?nav=cxorlb and selected the windows installer for Oracle 8i, Python 2.4 >From the readme.txt file: BINARY INSTALL: Place the...
0
by: cirudinezidane | last post by:
Hi!! I'd like to install Oracle 10 g express edition over Ubuntu to use with Python 2.4. I have installed Ubuntu, Python 2.4 and Oracle database. I think that I have installed correctly...
7
by: Carl K | last post by:
I am trying to use this: http://python.net/crew/atuining/cx_Oracle/html/cx_Oracle.html it is a real module, right? sudo easy_install cx_Oracle did not easy_install cx_Oracle. ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.