-
Notifications
You must be signed in to change notification settings - Fork 361
Description
I know I am in a grey area here but I thought I would give it shot.
Any help would be greatly appreciated. If there is a better venue for this please advise.
cx_Oracle works perfectly from IDLE and sqlplus does also
I am trying to get it to work with PyCharm
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 /Applications/PyCharm.app/Contents/helpers/pydev/pydevconsole.py 51803 51804
PyDev console: starting.
import sys;
print('Python %s on %s' % (sys.version, sys.platform))
sys.path.extend(['/Users/Face/PycharmProjects/PyTest'])
Python 3.6.1 (v3.6.1:69c0db5050, Mar 21 2017, 01:21:04)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
import os
os.environ['DYLD_LIBRARY_PATH'] = '/Users/Face/instantclient_12_1'
os.environ['LD_LIBRARY_PATH'] = '/Users/Face/instantclient_12_1'
import sys
sys.path.append("/usr/local/lib")
sys.path.append("/Users/Face/instantclient_12_1")
print(sys.path)
['/Applications/PyCharm.app/Contents/helpers/pydev', '/Users/Face/instantclient_12_1', '/Users/Face/anaconda/lib/python3.6/site-packages', '/Applications/PyCharm.app/Contents/helpers/pydev', '/Library/Frameworks/Python.framework/Versions/3.6/lib/python36.zip', '/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6', '/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload', '/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages', '/Users/Face/anaconda/lib/python3.6/site-packages/IPython/extensions', '/Users/Face/anaconda/lib/python3.6/site-packages/IPython/extensions', '/Users/Face/PycharmProjects/PyTest', '/usr/local/lib', '/Users/Face/instantclient_12_1']
import cx_Oracle
print(cx_Oracle.clientversion())
(12, 1, 0, 2, 0)
ip_addr = '192.168.1.19'
port = 1521
sid = 'xe'
dsn_tns = cx_Oracle.makedsn(ip_addr, port, sid)
db = cx_Oracle.connect('xxxxx', 'xxxxx', dsn_tns)
Traceback (most recent call last):
File "", line 5, in
cx_Oracle.InterfaceError: Unable to acquire Oracle environment handle
- What is your version of Python? Is it 32-bit or 64-bit?
3.6 64bit - What is your version of cx_Oracle?
Client versions and database are aligned - What is your version of the Oracle client (e.g. Instant Client)? How was it
installed? Where is it installed?
(12, 1, 0, 2, 0), Client downloaded from Oracle website, cx was installed via PIP, /Users/Face/instantclient_12_1' - What is your version of the Oracle Database?
Same - What is your OS and version?
El Capitan 10.11.6 - What compiler version did you use? For example, with GCC, run
gcc --version.
GCC 4.2.1 - What environment variables did you set? How exactly did you set them?
See above since PyCharm doesn't see user environmental variables - What exact command caused the problem (e.g. what command did you try to
install with)? Who were you logged in as?
When I try to run the application - What error(s) you are seeing?
cx_Oracle.InterfaceError: Unable to acquire Oracle environment handle