python2 and python3 coexist under ubuntu

Solution: Create python2 and python3 environments separately
The premise is that anaconda is installed

1 Create an environment for python2
Open terminal and enter

conda create --name python2 python=2.7 (bold font is required for activation)

Waiting for the environment to be created

2 Create an environment for python3
Open terminal and enter
conda create --name python3 python=3.6 (bold font is required for activation)
Waiting for the environment to be created

3 Join to use Python2
Terminal input: source activate python2
When logging out: source deactivate python2
4 effects
picture

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324851108&siteId=291194637