Is it ok having both Anacondas 2.7 and 3.5 installed in the same time?

前端 未结 6 1549
半阙折子戏
半阙折子戏 2020-12-12 10:25

I am using currently Anaconda with Python 2.7, but I will need to use Python 3.5. Is it ok to have them installed both in the same time? Should I expect some problems?
I

相关标签:
6条回答
  • 2020-12-12 10:49

    I have python 2.7.13 and 3.6.2 both installed. Install Anaconda for python 3 first and then you can use conda syntax to get 2.7. My install used: conda create -n py27 python=2.7.13 anaconda

    0 讨论(0)
  • 2020-12-12 10:49

    Yes, It should be alright to have both versions installed. It's actually pretty much expected nowadays. A lot of stuff is written in 2.7, but 3.5 is becoming the norm. I would recommend updating all your python to 3.5 ASAP, though.

    0 讨论(0)
  • 2020-12-12 10:50

    My understanding is you don't need to install Anaconda again to start using a different version of python. Instead, conda has the ability to separately manage python 2 and 3 environments.

    0 讨论(0)
  • 2020-12-12 10:57

    I use both depending on who in my department I am helping (Some people prefer 2.7, others 3.5). Anyway, I use Anaconda and my default installation is 3.5. I use environments for other versions of python, packages, etc.. So for example, when I wanted to start using python 2.7 I ran:

     conda create -n Python27 python=2.7
    

    This creates a new environment named Python27 and installs Python version 2.7. You can add arguments to that line for installing other packages by default or just start from scratch. The environment will automatically activate, to deactivate simply type deactivate (windows) or source deactivate (linux, osx) in the command line. To activate in the future type activate Python27 (windows) or source activate Python27 (linux, osx). I would recommend reading the documentation for Managing Environments in Anaconda, if you choose to take that route.

    Update

    As of conda version 4.6 you can now use conda activate and conda deactivate. The use of source is now deprecated and will eventually be removed.

    0 讨论(0)
  • 2020-12-12 11:04

    Anaconda is made for the purpose you are asking. It is also an environment manager. It separates out environments. It was made because stable and legacy packages were not supported with newer/unstable versions of host languages; therefore a software was required that could separate and manage these versions on the same machine without the need to reinstall or uninstall individual host programming languages/environments.

    You can find creation/deletion of environments in the Anaconda documentation.

    Hope this helped.

    0 讨论(0)
  • 2020-12-12 11:06

    Yes you can.

    You don't have to download both Anaconda.

    Only you need to download one of the version of Anaconda and need activate other version of Anaconda python.

    If you have Python 3, you can set up a Python 2 kernel like this;

    python2 -m pip install ipykernel
    
    python2 -m ipykernel install --user
    

    If you have Python 2,

    python3 -m pip install ipykernel
    
    python3 -m ipykernel install --user
    

    Then you will be able to see both version of Python!

    If you are using Anaconda Spyder then you should swap version here:

    If you are using Jupiter then check here:

    Note: If your Jupiter or Anaconda already open after installation you need to restart again. Then you will be able to see.

    0 讨论(0)
提交回复
热议问题