查看: 1772|回复: 0

Installing a different version of Python in anaconda

[复制链接]

81

主题

162

帖子

493

积分

推广大使

积分
493
发表于 2018-12-26 15:57:32 | 显示全部楼层 |阅读模式

To install a different version of Python without overwriting the current version, create a new environment and install the second Python version into it:

  • Create the new environment:

    • To create the new environment for Python 3.6, in your Terminal window or an Anaconda Prompt, run:

      conda create -n py36 python=3.6 anaconda

      NOTE: Replace py36 with the name of the environment you want to create. anaconda is the metapackage that includes all of the Python packages comprising the Anaconda distribution. python=3.6 is the package and version you want to install in this new environment. This could be any package, such as numpy=1.7, or multiple packages.

    • To create the new environment for Python 2.7, in your Terminal window or an Anaconda Prompt, run:

      conda create -n py27 python=2.7 anaconda


  • Activate the new environment.

  • Verify that the new environment is your current environment.

  • To verify that the current environment uses the new Python version, in your Terminal window or an Anaconda Prompt, run:

    python --version



回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表