Anaconda installation and usage tutorial under ubuntu

foreword

I haven't used anaconda for a long time, and I still remember the happy time when I used anaconda. I miss pytorch and paddlepaddle (flying pulp), but life (after changing the ubuntu system) taught me to be cruel (it may be difficult to have the opportunity to use anaconda on windows). Find some time and install anaconda of ubuntu.

Anaconda

Anaconda is a Python distribution for scientific computing and data science, which provides a powerful environment management system and a large number of scientific computing, data analysis and machine learning libraries. Here are some key advantages of Anaconda:

  • Environment management: Anaconda provides a package management and environment management tool called "conda". With conda, you can create and manage multiple independent Python environments. Each environment can have different Python versions and installed libraries, so that conflicts between libraries can be avoided, and different projects can be easily switched and managed.

  • Integrated Development Environment (IDE): Anaconda includes Jupyter Notebook, a very popular interactive computing environment for creating and sharing documentation, including code, diagrams, and explanatory text. Jupyter Notebook supports multiple programming languages, including Python, R, and Julia.

  • Anaconda Navigator: This is a visual user interface for managing environments, installing libraries, and launching applications. With Anaconda Navigator, you can easily browse and install available libraries and tools, as well as manage your environment and projects.

  • Cross-platform support: Anaconda can run on mainstream operating systems such as Windows, macOS, and Linux.

Using Anaconda can greatly simplify the workflow of scientific computing and data analysis. By creating isolated environments, you can easily manage the dependencies of different projects and ensure the environment consistency of your projects. In addition, Anaconda's extensive library support and integrated development environment make it easier to write, test, and share code.

Official website download

https://www.anaconda.com/download#downloads

insert image description here

Install

bash Anaconda3-2023.07-2-Linux-x86_64.sh

insert image description here

carriage return, carriage return,

insert image description here

Enter yes,

insert image description here

The installation path is under /home/username/anaconda3 by default, you can choose to modify it, and start the installation after confirming the installation path.

insert image description here

initialize, yes,

insert image description here

Successful installation! ! !

insert image description here

source ~/.bashrc

insert image description here
You can see that (base) appears.

View anaconda version

conda -V

insert image description here

Create a conda environment and specify the Python version

We create an environment named python3.8 with python version 3.8.

conda create --name python3.8 python=3.8

switching between environments

conda activate python3.8
conda activate #回到base
conda deactivate #退出当前环境

insert image description here

Installation package

conda install numpy
#或者
pip install numpy

List all packages in the current environment

conda list

insert image description here

uninstall package

conda remove request
# 或者
pip uninstall requests

delete environment

conda remove --name python3.8 --all

About Jupyter Notebooks

Jupyter Notebook is an open source interactive computing environment for creating and sharing documents, including live code, visualized results, explanatory text, and multimedia content. It is one of the very popular tools in the field of data science and scientific computing. Here are some key features and capabilities of Jupyter Notebook:

  • Interactive Computing: Jupyter Notebook provides an interactive environment to execute code cell by cell. This means you can write a line of code in a code block and see the result immediately. This real-time feedback feature makes debugging and exploring data more convenient and intuitive.

  • Multi-language support: Jupyter Notebook was originally developed for Python, but now supports multiple programming languages, including R, Julia, and Scala. This allows you to use different programming languages ​​for calculations and analysis in the same notebook.

  • Rich display functions: Jupyter Notebook allows you to insert multimedia elements such as rich text content, mathematical formulas, charts, pictures and videos into the notebook. You can use Markdown syntax to write beautiful text, and you can also use libraries such as Matplotlib and Bokeh to draw interactive charts and visualize results.

  • Data exploration and analysis: Jupyter Notebook provides an interactive environment to easily load and manipulate data and apply various data analysis techniques. You can use libraries like Pandas, NumPy, SciPy, etc. for data cleaning, transformation, and statistical analysis. By combining code, text descriptions, and visualizations, you can better understand and present data.

  • Collaborate and share: Jupyter Notebook allows you to save notebooks as executable files and easily share them with others. In this way, others can reproduce your analysis process, modify and expand on it. In addition, Jupyter Notebook also supports exporting to multiple formats, such as HTML, PDF, and Markdown.

  • Kernels and extensions: Jupyter Notebook uses kernels to execute code, and there are kernels for each programming language. You can install and switch between different kernels to use different programming languages ​​in the same notebook. In addition, Jupyter Notebook also supports various extensions, which can add additional functions and integrate other tools.

Guess you like

Origin blog.csdn.net/weixin_43912621/article/details/132649944