Python and anaconda coexist_How to achieve multi-version python coexistence in Anaconda

The Python version in anaconda is 3.5. Because of the crawler, Python 2.7 version is required. Therefore, I hope that Python3 and Python2 can coexist in anaconda.

1. Open Anaconda Prompt and use conda --version to view the conda version.

2. Create an environment named python27 and install Python2.7: conda create --name python27 python=2.7

3. Activate python27: activate python27

4. Find the installed python2.7 in pycharm

File -> Settings -> Select Project: prjectName (your own project name) -> Porject Interpreter -> Select the required python version in Porject Interpreter.

Because python2.7 is newly installed here, there is no python2.7 in Porject Interpreter. You must first click Settings -> Add local to find the installation path of python2.7.

At this point, the steps for Anaconda to configure multiple versions of Python have been completed.

If you want to use Python2.7 on Spyder, you also need to install the Spyder IDE corresponding to Python2.7 (conda install spyder). You can also click "install" directly in Anaconda Navigator to install it.

reference:

Guess you like

Origin blog.csdn.net/weixin_39789370/article/details/111436819