search
HomeBackend DevelopmentPython TutorialFor Python beginners, the complete version of Anaconda Getting Started Guide_python

I believe that most Python beginners have had headaches due to environmental issues, but you are not alone, everyone has suffered like this. In order to avoid detours when getting started, and to prevent the high enthusiasm from being too dampened, it is recommended to use Anaconda to manage your installation environment and various tool packages

If you plan to learn Python for data analysis, Did you encounter all kinds of troubles at the beginning?

Should I install Python2 or Python3?
Why do I always get errors when installing Python?
How to install the toolkit?

Why is it prompted that a bunch of other unknown tools must be installed before installing this tool?
I believe that most Python beginners have had headaches due to environmental issues, but you are not alone, everyone has suffered like this. In order to avoid detours when getting started, and to prevent the high enthusiasm from being too dampened, it is recommended to use Anaconda to manage your installation environment and various tool packages.

This article introduces the use of Anaconda. The full text outline is as follows:

Why choose Anaconda
* What is Anaconda
* What is conda
* Advantages of Anaconda

How to install Anaconda
How to manage Python packages
How to manage the Python environment

1. Why choose Anaconda?

1.1 What is Anaconda?

Anaconda is a Python distribution focused on data analysis, including more than 190 scientific packages such as conda and Python and their dependencies. As a curious baby, have you discovered a new term conda? Then you will definitely ask what is conda?

1.2 What is conda?

conda is a management system for open source packages and virtual environments.

  • packages management: You can use conda to install, update, and uninstall tool packages, and it focuses more on data science-related tool packages. When installing anaconda, packages commonly used in data analysis such as Numpy, Scipy, pandas, and Scikit-learn are pre-integrated. It is also worth mentioning that conda not only manages Python tool packages, it can also install non-python packages. For example, the R language integrated development environment Rstudio can be installed in the new version of Anaconda.

  • Virtual environment management: Multiple virtual environments can be established in conda to isolate different versions of tool packages required by different projects to prevent version conflicts. For students who are confused about the Python version, we can also create two environments, Python2 and Python3, to run different versions of Python code respectively.

While knowing what it is, we also need to ask why. So, why should you choose Anaconda?

1.3 Advantages of Anaconda?

The advantages of Anaconda can be summed up in eight words: saving time and worry, and being a powerful analysis tool.

  • Save time and worry: Anaconda greatly simplifies your workflow by managing tool packages, development environments, and Python versions. Not only can the tool package be easily installed, updated, and uninstalled, but also the corresponding dependency packages can be automatically installed during installation. At the same time, different virtual environments can be used to isolate projects with different requirements.

  • Analysis tool: Anaconda promotes itself on its official website as follows: a Python tool suitable for enterprise-level big data analysis. It contains more than 720 open source packages related to data science, covering many aspects such as data visualization, machine learning, and deep learning. Not only can it be used for data analysis, it can even be used in the fields of big data and artificial intelligence.

After solving the "what" and "why" questions, let's take a look at the "How".

2. How to install Anaconda?

You can download the Anaconda installer and view the installation instructions from here. Whether it is Windows, Linux or MAC OSX system, you can find the corresponding installation software. If your computer is 64-bit, try to choose the 64-bit version. As for whether the Python version is 2.7 or 3.x, it is recommended that you use Python3 because Python2 will eventually stop maintenance. Maybe most of the tutorials on the market currently use Python2, but don’t worry, because Anaconda can manage two Python versions of the environment at the same time.

Install according to the prompts. After completion, you may be surprised to find that there are many more applications on your computer. Don’t worry, let’s look at them one by one:

  • Anaconda Navigtor : A graphical user interface for managing toolkits and environments. Many subsequent management commands can also be implemented manually in Navigator.

  • Jupyter notebook: A web-based interactive computing environment that can edit documents that are easy for people to read and used to display the process of data analysis.

  • qtconsole: A terminal-like graphical interface program that can execute IPython. Compared with the Python Shell interface, qtconsole can directly display the graphics generated by the code, realize multi-line code input execution, and have many built-in Useful features and functions.

  • spyder: A cross-platform, scientific computing integrated development environment using Python language.

After the installation is completed, we also need to upgrade all tool packages to avoid possible errors. Open the terminal of your computer and enter in the command line:

conda upgrade --all

When the terminal asks whether to install the following upgrade version, enter y.
In some cases, you may encounter an error message that the conda command cannot be found. This is likely to be a problem with the environment path setting. You need to add the conda environment variable: export PATH=xxx/anaconda/bin:$PATH, Replace xxx with the installation path of anaconda.
Now that the installation is complete, let’s take a look at how to use Anaconda to manage tool packages and environments.

3. How to manage Python packages?

Install a package:

conda install package_name

Here package_name is the name of the package that needs to be installed. You can also install multiple packages at the same time, such as installing numpy, scipy and pandas at the same time, then execute the following command:

conda install numpy scipy pandas

You can also specify the version to be installed, such as installing 1.1 version of numpy:

conda install numpy=1.10

Remove a package:

conda remove package_name

Upgrade package version:

conda update package_name

View all packages:

conda list

If you can’t remember the specific name of the package, you can also perform a fuzzy query:

conda search search_term

4. How to manage the Python environment?

The default environment is root, you can also create a new environment:

conda create -n env_name list of packages

where -n represents name, env_name is the name of the environment that needs to be created, and list of packages lists the tool packages that need to be installed in the new environment.

For example, when I installed the Python3 version of Anaconda, the default root environment is naturally Python3, but I also need to create a Python 2 environment to run the old version of Python code. It is best to install pandas package, so we run the following command to create it:

conda create -n py2 python=2.7 pandas

If you are careful, you will definitely find that not only is the py2 environment installed pandas and a series of packages such as numpy are also installed. This is the convenience of using conda. It will automatically install the corresponding dependency packages for you without requiring you to install them manually one by one.

Enter the environment named env_name:

source activate env_name

Exit the current environment:

source deactivate

Also note that in Windows systems, use activate env_name and deactivate to enter and exit an environment.

Delete the environment named env_name:

conda env remove -n env_name

Display all environments:

conda env list

When sharing code, you also need to share the running environment with everyone. Execute the following command to save the package information in the current environment into a YAML file named environment.

conda env export > environment.yaml

Similarly, when executing other people's code, you also need to configure the corresponding environment. At this time, you can use the YAML file shared by the other party to create an identical running environment.

conda env create -f environment.yaml

At this point, you have entered the door of Anaconda, and you can wander in the ocean of Python.

Happy studying!

Note: The code examples in this article are referenced from the Anaconda chapter of the Udacity data analysis course.

Related recommendations:

11 knowledge points you must know to get started with Python_python

Detailed introduction to the API interface of php

The above is the detailed content of For Python beginners, the complete version of Anaconda Getting Started Guide_python. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Learning Python: Is 2 Hours of Daily Study Sufficient?Learning Python: Is 2 Hours of Daily Study Sufficient?Apr 18, 2025 am 12:22 AM

Is it enough to learn Python for two hours a day? It depends on your goals and learning methods. 1) Develop a clear learning plan, 2) Select appropriate learning resources and methods, 3) Practice and review and consolidate hands-on practice and review and consolidate, and you can gradually master the basic knowledge and advanced functions of Python during this period.

Python for Web Development: Key ApplicationsPython for Web Development: Key ApplicationsApr 18, 2025 am 12:20 AM

Key applications of Python in web development include the use of Django and Flask frameworks, API development, data analysis and visualization, machine learning and AI, and performance optimization. 1. Django and Flask framework: Django is suitable for rapid development of complex applications, and Flask is suitable for small or highly customized projects. 2. API development: Use Flask or DjangoRESTFramework to build RESTfulAPI. 3. Data analysis and visualization: Use Python to process data and display it through the web interface. 4. Machine Learning and AI: Python is used to build intelligent web applications. 5. Performance optimization: optimized through asynchronous programming, caching and code

Python vs. C  : Exploring Performance and EfficiencyPython vs. C : Exploring Performance and EfficiencyApr 18, 2025 am 12:20 AM

Python is better than C in development efficiency, but C is higher in execution performance. 1. Python's concise syntax and rich libraries improve development efficiency. 2.C's compilation-type characteristics and hardware control improve execution performance. When making a choice, you need to weigh the development speed and execution efficiency based on project needs.

Python in Action: Real-World ExamplesPython in Action: Real-World ExamplesApr 18, 2025 am 12:18 AM

Python's real-world applications include data analytics, web development, artificial intelligence and automation. 1) In data analysis, Python uses Pandas and Matplotlib to process and visualize data. 2) In web development, Django and Flask frameworks simplify the creation of web applications. 3) In the field of artificial intelligence, TensorFlow and PyTorch are used to build and train models. 4) In terms of automation, Python scripts can be used for tasks such as copying files.

Python's Main Uses: A Comprehensive OverviewPython's Main Uses: A Comprehensive OverviewApr 18, 2025 am 12:18 AM

Python is widely used in data science, web development and automation scripting fields. 1) In data science, Python simplifies data processing and analysis through libraries such as NumPy and Pandas. 2) In web development, the Django and Flask frameworks enable developers to quickly build applications. 3) In automated scripts, Python's simplicity and standard library make it ideal.

The Main Purpose of Python: Flexibility and Ease of UseThe Main Purpose of Python: Flexibility and Ease of UseApr 17, 2025 am 12:14 AM

Python's flexibility is reflected in multi-paradigm support and dynamic type systems, while ease of use comes from a simple syntax and rich standard library. 1. Flexibility: Supports object-oriented, functional and procedural programming, and dynamic type systems improve development efficiency. 2. Ease of use: The grammar is close to natural language, the standard library covers a wide range of functions, and simplifies the development process.

Python: The Power of Versatile ProgrammingPython: The Power of Versatile ProgrammingApr 17, 2025 am 12:09 AM

Python is highly favored for its simplicity and power, suitable for all needs from beginners to advanced developers. Its versatility is reflected in: 1) Easy to learn and use, simple syntax; 2) Rich libraries and frameworks, such as NumPy, Pandas, etc.; 3) Cross-platform support, which can be run on a variety of operating systems; 4) Suitable for scripting and automation tasks to improve work efficiency.

Learning Python in 2 Hours a Day: A Practical GuideLearning Python in 2 Hours a Day: A Practical GuideApr 17, 2025 am 12:05 AM

Yes, learn Python in two hours a day. 1. Develop a reasonable study plan, 2. Select the right learning resources, 3. Consolidate the knowledge learned through practice. These steps can help you master Python in a short time.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Will R.E.P.O. Have Crossplay?
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft