问题
I need to connect to Oracle database in Python Anaconda3-2.5.0-Windows-x86_64. Installation of the cx_Oracle module by:
conda install -c https://conda.anaconda.org/anaconda cx_oracle
fails with following output (trimmed):
Hint: the following packages conflict with each other:
- cx_oracle
- python 3.5*
So I tried to install package for Python 3.5 by 'cx_Oracle-5.2.1-11g.win-amd64-py3.5.exe' from https://pypi.python.org/pypi/cx_Oracle/ Which seems to be working (somehow). Even 'conda list' command prints line:
cx-oracle 5.2.1 <pip>
But when I enter import cx_Oracle; in Python then
ImportError: DLL load failed: Uvedený modul nebyl nalezen.
appears. Rough translation of last localized part is 'Modul not found.'
How can I install the cx_Oracle module? Or is there any other way to connect to Oracle database?
回答1:
I'm assuming that you have windows and python 3.5 only installed. Check your anaconda just incase to make sure you are using anaconda3 or that anaconda is setup with python3 environment. Assuming all that checks out and you are still getting that same error try doing a fresh install of cx_oracle from pip.
On your windows machine open up cmd and type pip install cx_Oracle and it should install nicely. If you by chance have python2 installed as well you might want to do python3 -m pip install cx_Oracle. After installation completes you should be good to go.
回答2:
In the Anaconda navigator, select 'Environments', then on the right, change the filter to 'All'. Now you can query for 'cx_oracle', select it and at the bottom, select 'Apply'. Once completed, you should be able to
import oracle
回答3:
Download a precompiled version of the package and install it using easy_install.
回答4:
Easier way to load is to down load from the below link https://pypi.python.org/pypi/cx_Oracle/
and install it in Windows. It worked like a charm for me.
来源:https://stackoverflow.com/questions/35506441/how-can-i-instal-cx-oracle-package-to-anaconda-3-to-use-with-python-3-5