Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to manage Anaconda environment with conda

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to use conda to manage the Anaconda environment". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to manage the Anaconda environment with conda".

Anaconda also comes with a package management tool, conda, and has its own package repository and server. Here's a brief introduction to conda:

Conda is an open source package (packages) and virtual environment (environment) management tool dedicated to Anaconda.

Packages management: you can use conda to install, update, and uninstall toolkits, and it focuses more on toolkits related to data science. It's worth mentioning that conda doesn't just manage Python's toolkit, it can also install non-python packages. For example, Rstudio, the integrated development environment of R language, 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 toolkits required by different projects to prevent version conflicts. You can also set up Python2 and Python3 environments to run different versions of Python code.

Management Pack:

# confirm that conda has been installed: conda-- version# update conda version: conda update conda# query conda information: conda info# upgrade anaconda: conda update anaconda 1. Installation package: conda install package_name2. Install multiple packages at the same time: conda install numpy scipy pandas3. Install the specified version of conda install numpy=1.104. Remove the package conda remove package_name5. Update the package conda update package_name5. Update all packages conda update-all6. View all installed packages: conda list7. Query a package, or you can make a fuzzy query: conda search search_key_word

Environmental Management:

1. Create a new environment: conda create-n env_name list of packages, where-n represents the name of the environment you need to create, and list of packages lists the toolkits that need to be installed in the new environment at the same time. For example: conda create-n py3 python=3.7 pandas or copy an existing environment conda create-- name new_env-- clone old_env2. Enter the environment named env_name: source activate env_name3. Exit the current environment: source deactivate in Windows systems, use activate env_name and deactivate to enter and exit an environment. 4. Delete the environment named env_name: conda env remove-n env_name5. Show all environments: conda env list6. Check the environment information conda info-- envs7. When sharing the code with others, you also need to share the running environment. Execute the following command to save the package information in the current environment into a YAML file named environment. Conda env export-- name env_name > environment.yaml similarly, when executing someone else's code, you also need to configure the appropriate environment. At this point, you can use the YAML files shared by each other to create a similar runtime environment. Conda env create-f environment.yaml thank you for reading, the above is the content of "how to use conda to manage Anaconda environment". After the study of this article, I believe you have a deeper understanding of how to use conda to manage Anaconda environment, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report