Unable to connect using cx_Oracle in a Jupyter notebook on VSCode - python-3.x

I keep getting the following error when I try to execute the cell in a Jupyter notebook on VSCode
con = cx_Oracle.connect("/#DB")
DatabaseError: DPI-1047: Cannot locate a 64-bit Oracle Client library: "libclntsh.so: cannot open shared object file: No such file or directory". See https://oracle.github.io/odpi/doc/installation.html#linux for help
But the same works fine when I run it in Jupyter Lab.

Sometimes stuff just doesn't work in some IDEs, i am not sure what your question is, i suggest using anaconda (and maybe spyder specifically) it has worked for me with everything so far, but i don't know about cx_Oracle.

If you are using Oracle Instant Client, and it is the only Oracle software on the computer, then use the ldconfig command to set the library search path. This is always less error prone than trying to set LD_LIBRARY_PATH. See the Instant Client installation instructions.

Related

How To access Cx_Oracle on Pivotal cloud factory (PCF)

I am trying to deploy my Python code where it involves usage of Oracle connection using cx_oracle module.
I referred the below link to set up my LD_LIBRARY_PATH
Deploy instant oracle on Pivotal CloudFoundry for cx_Oracle
export LD_LIBRARY_PATH=C:/Users/pm/Documents/project_1/oracle/instantclient_19_9:${LD_LIBRARY_PATH:-}
export OCI_LIB_DIR=C:/Users/pm/Documents/project_1/oracle/instantclient_19_9
export OCI_INC_DIR=C:/Users/pm/Documents/project_1/oracle/instantclient_19_9/sdk/include
Still facing same issue once code is pushed on to PCF.
[ERR] cx_Oracle.DatabaseError: DPI-1047: Cannot locate a 64-bit Oracle Client library: "libclntsh.so: cannot open shared object file: No such file or directory".
I have downloaded the oracle client zip file for windows 64bits 19.9 version.
And unzipped into the folder in my desktop path where my application is stored and used to push the code to pcf(C:/Users/pm/Documents/project_1/).
Could someone please guide me if any of the steps need modification and help me fix the issue.
On Windows the environment variable you want to manipulate is PATH. If that doesn't help, you can also use the environment variable DPI_DEBUG_LEVEL and set that to the value 64. That will show you all of the paths that are being tried.
You can see all of this in the installation manual.

I Have created Exe Using Pyinstaller.How to bundle Cx_racle into this

My Script is having import cx_oracle where it is connecting to Oracle DB and doing some action. I have created exe for Windows machine using pyinstaller and tried to achieve same in my machine it is working properly. When I tried in another machine without installing python it is throwing an error like below.
Please help how can I overcome this issue.
Error:
cx_Oracle.DatabaseError: DPI-1047: 64-bit Oracle Client library cannot be loaded: "The specified module could not be found". See https://oracle.github.io/odpi/doc/installation.html#windows for help
[1856] Failed to execute the script
Hi Finally after long time trial and error. Found the resolution.
the machine where you want to run the stand-alone application that is using cx_Oracle please follow below steps for windows:
1.Download the instant client form the below URL.
https://oracle.github.io/odpi/doc/installation.html.
2. Unzip it and copy the path set it in Environment Variable.
3. After this, I have executed exe its worked fine foe me.

Linux Autotest: AttributeError

I just started trying Autotest for Linux kernel. I installed Ubuntu 16.04 into VirtualBox. And then downloaded autotest and the linux developer package.
When I run the included tests I get errors similar to "AttributeError: xxx object has no attribute yyy". There is a lot of them! I expected it to work straight out of the box.
The only step that I skipped was setting up the host side. I am wondering if it is the source of my errors. The docs say to run the host side once to set everything up. But I don't want to connect to the cloud etc ... Can I just run everything on the client side? Is there a way to set it up to run client only?
Any packages that I am missing?
Thanks!

Installing a oracle forms development machine

After working with Oracle databases and Apex for many years, I want to get some knowledge about Oracle forms & reports, because they are still quite widely used.
I've never seen Oracle forms & reports, so I want to create a development installation for learning purposes. Unfortunately installing Oracle forms seems a bit more tedious than I expected and I'm a bit stuck.
Windows installation
I first tried installing Oracle 12c (from http://www.oracle.com/technetwork/developer-tools/forms/downloads/index.html) on windows 7 x64. I installed the "Standalone forms builder", because when I chose "Forms and reports deployment", I got this error:
After installation I tried to start frmbld.exe, but immediately got this error:
FRM-91135: fatal error: message file D:\oracle\client\user123\product\12.1.0\client_1\forms\mesg\fmcus.msb not found
My oracle client is installed in that directory, but the mentioned file is certainty not there.
linux installation
Googling around I did not find any solution for this problem, so i decided to switch to a Linux virtual box machine. I installed Oracle linux x64 and then installed with a download from the same page again.
Once more I could only choose "Standalone forms builder", when I chose "Forms and reports deployment" I got exactly the same error as on windows. The installation ran successful.
After installation I tried to start formbuilder, this time I was presented this error:
./frmbld: error while loading shared libraries: libXm.so.3: cannot open shared object file: No such file or directory
So now I'm a bit stuck. My questions are:
Am I going the right way with the way I'm trying to install Oracle forms? or is there a better / easier way?
Do I need a "Forms and reports deployment" to be able to experiment with Oracle forms? or is the standalone installation the right way to go?
Are there any pre-installed virtual machines available for this? (I googled but couldn't find anything.)
Do I need a running Oracle database to be able to experiment with Oracle forms?
Linux installation:
Yes you are going the correct path installing Forms/Reports. There is no easier install method (Oracle does not have a prebuilt VM with Forms/Reports).
You will require an Oracle database to connect to.
To fix the linux error you will need to install additional OS packages, probably motif - you can run (to find the packages required): yum whatprovides libXm*
I have installed Forms Builder 12c (standalone install) on Fedora and it is working correctly.
The windows error might be related to you OS PATH ENV - if you have any other Oracle products installed, the PATH order may need to be changed, put the Forms related paths at the beginning.
Unfortunately I was unable to get it properly working with my previous attempts. In the end I restarted an installed a windows 10 x64 virtual machine, after which i followed these excellent video's to get everything working: https://www.youtube.com/watch?v=4tgtHPJGc7o

Odoo Mac OSX installation get error "Could not execute command lessc" in PyCharm Community Edition

I installed Odoo 9 on Mac OSX using Homebrew virtual environment.
I installed npm, less and less-plugin-clean-css.
Finally if I launch Odoo from the Mac Terminal, using the appropriate parameters, everything goes well and I can enter my odoo with localhost:8069.
I then setup PyCharm Community Edition for odoo development, but when I run odoo from within PyCharm I get the error:
"Could not execute command lessc"
and obviously the web layout is totally wrong.
I saw here NodeJS plugin in IntelliJ Community Edition does not work that you cannot use NodeJS plugin with PyCharm CE.
My question then is: "How to enable PyCharm CE to use less and get rid of the error?".
If you are in Pycharm in getting error Could not execute command lessc and you have installed less which you can check by entering lessc command in terminal
Fix:
If you are using virtualenv then activate virtualenv from terminal and restart the server again from terminal, this time it won't give any error.
If you are not using virutalenv then you can just run from terminal server without any problems
I'm not sure why this problem is specific to PyCharm.
I had the same issue from PyCharm Professional, but I solve this issue with this way
When i finish installing the PyCharm pro ,then i set the environment variables in the 'run/debug configuraition'
(/usr/loca/bin)
which value(path) i found is using command "which lessc" in the terminal
Then I think the PyCharm can find lessc, and finnally I get rid of this nightmare
`Could not execute command 'lessc'
For me, updating the node was the solution. It was version 0.10.33. Now it's 6.1.12.
Check out this answer. You must uninstall node and reinstall it in a certain order:
https://stackoverflow.com/a/36395799?noredirect=1
At least that is what worked for me.

Resources