简体   繁体   中英

How does installing packages on anaconda work?

To install a package, I know I have to create an environment in Anaconda. I was wondering if I could create an environment and add 3-4 packages such as Matplotlib, Keras, Tensorflow together, or would that cause some error?

If you already have your environment created, you activate it on the anaconda command console and then you add the packages as you can see in the following link:

https://docs.anaconda.com/anaconda/user-guide/tasks/install-packages/

Most of the high profile packages as the ones you listed have no issues being installed on the same environment

You can certainly do that. Just run conda install matplotlib keras tensorflow after making your environment.

Why It Works The reason this works is because an environment is a place where an interpreter and a collection of libraries reside. The reason we do this is so that we can have many versions of the same library in the same computer. It is a sandbox for libraries. Unless you try to install different versions of the same library on the same environment, you can install as many packages as you like.

What does Anaconda Do? All Anaconda is doing is making a wrapper so that every time you enter the environment, your python commands redirect to the separate python executable in the env folder. It also sends all the library requests to that env to handle. This means that you can use a hundred libraries without installing one globally on your computer.

How To Setup Anaconda

  1. Open Anaconda Navigator and click the Environments button. 在此处输入图像描述

  2. Click create在此处输入图像描述

  3. Name it and select the Python interpreter that you have. 在此处输入图像描述

  4. Hit create and then on the dropdown, select all. 在此处输入图像描述

  5. Then say you want to install Matplotlib, then go to the search bar and search it up. 在此处输入图像描述

  6. Then select the package you want and hit apply. 在此处输入图像描述

7. It will ask for confirmation and then the package should be installed. You can install as many as you like. Also, to see the packages you have installed, select Installed instead of All in the dropdown. You can put all of your packages in one place!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM