Details of anaconda and pycham configuration methods under Ubuntu


This article shared the configuration methods of anaconda and pycham under Ubuntu for your reference. The specific contents are as follows

1. For Ubuntu 18.04, there will be a default Python interpreter at the beginning, which is version 3.6, located at / usr / bin / Python 3.6. You can view it by typing Python or python3 in terminal.

2. After installing anaconda3, Anaconda will bring a Python interpreter, which is also version 3.6. The location is / home / Li / anaconda3 / bin / python3. Once anaconda is installed, python becomes the default. Enter Python directly in terminal, and this is the position displayed.

3. The default python of anaconda is a virtual environment using Python outside the system, which is called base. The libraries installed under this environment will not conflict with the Python and libraries provided by the system. An asterisk indicates the default.

4. In addition, various custom environments can be virtualized on anaconda, and python version and library version can be selected. For example, I created a new environment named python2, which is located at / home / Li / anaconda3 / envs / python2 / bin / python, where python2 is the name I gave to the virtual environment. The new environment can be created through the anaconda operation interface or by using instructions.

5. Other Anaconda instructions are as follows

Create environment, you can specify version

conda create --name your_env_name
conda create --name your_env_name python=2.7
conda create --name your_env_name python=3
conda create --name your_env_name python=3.5

Create an environment that contains some packages, and you can specify the package version

conda create --name your_env_name numpy scipy
conda create --name your_env_name python=3.5 numpy scipy

List all current environments, entry and exit environments

conda info --envs
conda env list
source activate your_env_name
source deactivate 

uninstall Anaconda

rm -rf ~/anaconda3

6. When you select interpreter in pycharm, select CONDA environment. Then choose Python in the base environment or other environments, so you can get the python you want and the libraries in that environment.

In this figure, the default Python interpreter is selected. You can see that many packages below are not available.

This time, the default Python interpreter of anaconda is selected, and tensorflow is in it.

If you choose the interpreter in Python 2, you can see that there are only some basic libraries in this virtual environment.

The above is the whole content of this article. I hope it will help you in your study, and I hope you can support developepaer more.