0

I do most of my work in Python 2.7, but I've recently encountered some tutorials that require 3.4. Fine. I checked and Anaconda allows installation of both under Linux (Fedora 22 to be precise). However, now I seem to be stuck in 3.4. I followed the Anaconda directions, entering: conda create -n py3k python=3 anaconda source activate py3k I would like to be able to choose between 2.7 and 3.4 each time I run Python. Any ideas?

BrianM
  • 43
  • 1
  • 8
  • What is the problem? Is there an error? – Mikko Ohtamaa Aug 11 '15 at 12:26
  • `conda create -n py27 python=2.7 anaconda` - `source activate py27`? :) – cel Aug 11 '15 at 12:27
  • my answer here may be more detailed on how to make effective use of conda environments: http://stackoverflow.com/questions/27708882/how-to-install-python-libraries-under-specific-environments/27712027#27712027 – cel Aug 11 '15 at 12:53
  • I'm afraid the question is much more simple: As I said above, I started with a standard install of 2.7. I activated py3k, the name I gave the 3.4 installation. What is the command to close that version and activate 2.7?? – BrianM Aug 11 '15 at 20:06
  • You can give alias to launch different python versions. eg. defaullt python will be in `/usr/lib/python` or `/usr/lib/python2.7`. Give an alias to this and give another alias to anaconda version. I have done it that way in my computer. You dont have to use environments. In that way it is cleaner. Hope it helps. – GadaaDhaariGeek Nov 03 '17 at 11:15

1 Answers1

0

I think I can answer my own question. Python 2.7 seems to be the default. If I activate 3.x with source activate py3k I need to reboot to go back to 2.7, which, being the default, happens automatically.

If anyone knows a cleaner way, please let me know.

BrianM
  • 43
  • 1
  • 8
  • OK, when I was installing 3.x on another computer I saw a message I had missed during the first install: ```To deactivate this environment, use: $ source deactivate. ``` – BrianM Aug 12 '15 at 13:05