Package : cx_Oracle for Python 3.5, windows64 bit.

2019-04-13 02:20发布

问题:

I am trying to install cx_Oracle on my windows PC. I ran following command in command prompt:

pip install cx_Oracle

This is giving me the following error:

Collecting cx-Oracle
Could not find a version that satisfies the requirement cx-Oracle (from versions: )
No matching distribution found for cx-Oracle

I am using windows 64bit machine and Python 3.5(Anaconda3). Intsalled Oracle vcersion on my PC is Oracle 11.2.0.1.0 and oracle-instantclient version oracle-instantclient-11.2.0.4.0-0

Please let me know what am I missing. Should I downgrade my python version to 3.4? If yes, than how to do it using command line in Anaconda?

回答1:

I got past this issue by following these steps:

Create a Python 3.4 environment

Windows + R to open Run

Type 'cmd' (no apostrophes) and hit enter to open the command prompt.

Type the following:

$ conda create -n py34 python=3.4 anaconda

Activate and update the new environment

$ activate py34    
$ conda update conda

Uninstall and reinstall the qt aspect of Spyder

This step fixes a qt issue with Spyder when trying to open from your py34 environment

$ conda remove qt --name py34 
$ conda install qt=4.8.7=vc10_4

To Test

Make sure you have your py34 environment activated.

$ spyder # will launch spyder

In the Interactive Console in Spyder type:

$ import cx_Oracle # the O in Oracle must be capitalized

If it doesn't error out, you're done!

My solutions were found mostly based on the following postings:

http://conda.pydata.org/docs/py2or3.html
https://github.com/spyder-ide/spyder/issues/2858



回答2:

Python 3.5 binaries of cx_Oracle were made available on January 18. See here:

https://pypi.python.org/pypi/cx_Oracle/