-2

The end purpose of using Python3.x is because - as far I understand - in order to be able to use cx_Oracle, I need to use Python with Oracle so that three components must all be inplace and be of the same version:

Part 1: Anaconda Python 3.5 (64-bit)
Part 2: cx_Oracle for Python 3.5 (64-bit)
Part 3: Oracle 64-bit Instant Client (64-bit)

I just updated Python to 3.5.2. When running my script, this is confirmed:

3.5.2 |Anaconda 4.2.0 (64-bit)| (default, Jul  5 2016, 11:41:13) [MSC v.1900 64 bit (AMD64)]

When using the Python console, I have an option:

Anaconda2 (C:\Users\Pymat\AppData\Local\Continuum\Anaconda2\python.exe
C\:Python27\python.exe
Anaconda3 (C:\Users\Pymat\AppData\Local\Continuum\Anaconda3\python.exe

I can't get the Anaconda versions to work, since I get the following error messages:

'Create Interactive Console' has encountered a problem.
Error initializing console.

So I'm forced to use C\:Python27\python.exe However when switching to the Python console this is confirmed as a different version (as expected, since Python27 is now used. See above):

import sys
print sys.version
--> 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit (AMD64)]

I'd like to retain consistency in the versions, so I know that Python 3.5 is being used, in order to attain compatibility ready for successful use of cx_Oracle. Where am I going wrong?

---- Update ----

I deleted all versions of Python, and also the versions in Anaconda (I did a simple deinstall), then reinstalled via Anaconda, first v2.7 then v3.6, so now I have two interpreters pointing to the python.exe in the Anaconda packages (2 & 3). I can run my script using the Python v3 interpreter and the version confirmed is now:

3.6.0 |Anaconda 4.3.0 (64-bit)| (default, Dec 23 2016, 11:57:41) [MSC v.1900 64 bit (AMD64)]

However, I cannot open the Python Console and still get the same error message as above:

'Create Interactive Console' has encountered a problem.
Error initializing console.

In cmd, in the python shell the version is Python2.7.13. The command py doesn't work anymore. I don't get the inconsistency with this.

pymat
  • 1,090
  • 1
  • 23
  • 45
  • Do you have both python2 and python3 installed on your system using the Anaconda distribution installer? If that's the case, you may have an issue in your path - where both `python` executables are being found and that may be causing your problem. I have python3 installed on my system, and use python2 in a conda environment. That way Anaconda can handle issues related to my path – cbcoutinho Feb 21 '17 at 15:38
  • Ahha, that sounds like it could be the issue. I assume to resolve I'll need to delete one version, and reinstall (either on the system or conda environment)? – pymat Feb 21 '17 at 15:41
  • I see that the Python3 version is installed under a different path: C:\Users\Pymat\AppData\Local\Programs\Python\Python36 and this appears to be my default in Command (i.e. when I type "py" not "python", this 3.6 version is used). However typing "python", the 2.7 version is used. I need to clear this up somehow, as I also have different versions installed via the Anaconda environment, so things are getting confusing. – pymat Feb 22 '17 at 07:45

1 Answers1

0

I think you may have installed both python2 and python3 versions of the Anaconda distribution independently - and then also a third instance of python3.6 explicitly?? That is going to cause you headaches.

I would suggest you uninstall/remove the extra explicitly installed python3.6 installation, and then delete one of the Anaconda installation. I personally have python3 as my default installation, and then have an python2 environment that I use if I really need to. Base on the documentation, you can create a python2 environment as follows:

conda create -n py27 python=2.7 anaconda

And then you would temporarily activate it (on windows) using:

activate py27

The rest of the documentation related to managing python versions using Anaconda is here

cbcoutinho
  • 634
  • 1
  • 12
  • 28
  • Hi, the first command didn't work. I'm not sure why, but I received the following: CondaHTTPErropr: HTTP None None for url . – pymat Feb 22 '17 at 15:32
  • from that error message it looks like there was settings file deleted that conda is looking for. I'd like to help if possible - please give a complete run down of what is currently installed, what's in your path, where you think conda, python, and other related executables are, and what you are trying to do. If that's too much trouble - delete everything python related and start over with _only one_ anaconda installer. – cbcoutinho Feb 22 '17 at 17:57
  • I created a new question that encompasses this issue here: http://stackoverflow.com/questions/42411600/installing-the-python-cx-oracle-module-in-windows-and-connecting-to-an-oracle-da – pymat Feb 23 '17 at 09:25