Im using python 2.7 and cx_oracle ( Windows x86 Installer (Oracle 10g, Python 2.7) ) and 'm having a bad time to set this simple example bellow to work:
import cx_Oracle
connection = cx_Oracle.connect('user/pass@someserver:port')
cursor = connection.cursor()
cursor.execute('select sysdate from dual')for row in cursor:print row
connection.close()
Error Message:
Traceback (most recent call last):File "C:\ORACON.py", line 1, in <module>import cx_Oracle
ImportError: DLL load failed: The specified module could not be found.
For now, what i have done was:
1) installed the cx_oracle binary;
2) downloaded instantclient_10_2 from oracle website and exported the path to environment;
Anyone know what im missing?
Thank you for your time on reading this.
Answer
I was able to solve this problem with the following steps:
Download instantclient-basic-win32-10.2.0.5 from Oracle Website
unzipped the into my c:\ with the name oraclient
Created the directory structure C:\oraclient\network\admin to add the TNSNAMES.ORA
Added the TNS_ADMIN env var pointing to C:\oraclient\network\admin
Added the ORACLE_HOME env var pointing to C:\oraclient\
After that i used the following code:
import cx_Oraclecon = cx_Oracle.connect('theuser', 'thepass', 'your DB alias on your TNSNAMES.ORA file ')
cur = con.cursor()
if cur.execute('select * from dual'):print "finally, it works!!!"
else:print "facepalm"
con.close()
I have c++ library that need communicate with Python plugged in modules. Communication supposes implementing by Python some callback c++ interface. I have read already about writing extensions, but no …
I was looking at here to see how to expose c++ to Python. I have built Python deep learning code which uses boost-python to connect c++ and python and it is running ok, so my system has things for boos…
I am working with mongoengine and trying to do a simple migration. I have a field which I would like to migrate from being a StringField to a ReferenceField to another Object. I planned on doing the …
Here is my problem, I want to use one of the pretrain CNN network in a TimeDistributed layer. But I have some problem to implement it.Here is my model:def bnn_model(max_len):# sequence length and resne…
Usually, downloading a file from the server is something like this:
fp = open(file, wb)
req = urllib2.urlopen(url)
for line in req:fp.write(line)
fp.close()During downloading, the download process just…
After upgrading djangorestframework from djangorestframework==3.13.1 to djangorestframework==3.14.0 the code
from rest_framework.serializers import NullBooleanFieldThrowsAttributeError: module rest_fra…
I want to use dataframe values as column names and simplify the dataframe.I tried df.stack() and then index.map({0[0]}_{0[1]}.format)Input_df(Got this df by doing a groupby):link price dateA 1 …
I would like to replace the words in my dataframedf = pd.DataFrame({"Text": ["The quick brown fox jumps over the lazy dog"]})which match the keys in the following dictionarydic = {&…
I am working on unsupervised feature learning using autoencoders using Tensorflow. I have written following code for the Amazon csv dataset and when I am running it the cost is not decreasing at every …
Im working with dates since epoch, and already got, for example:date = 6928727.56235Id like to transform this into another relative format, so that Ill be able to transform this into something relative…