官术网_书友最值得收藏!

Anaconda/Miniconda distributions and conda package–and environment-management system 

Conda (https://conda.io/docs/is an open source package-management and environment-management system (provides virtual environment capabilities) that runs on many operating systems (for example, Windows, macOS, and Linux). Conda installs, runs, and updates packages and their dependencies. Conda can create, save, load, and switch between environments. 

As conda is included in all versions of Anaconda and Miniconda, you should have already installed Anaconda or Miniconda.

Anaconda is a downloadable, free, open source, high-performance Python and R distribution. Anaconda comes with conda, conda build, Python, and more than 100 open source scientific packages and their dependencies. Using the conda install command, you can easily install popular open source packages for data science from the Anaconda repository. Miniconda is a small version of Anaconda, which includes only conda, Python, the packages they depend on, and a small number of other useful packages.

Installing Anaconda or Miniconda is easy. For the sake of simplicity, we are focusing on Anaconda. To install Anaconda, check the Acadonda installer for your operating system (https://www.anaconda.com/download/). Anaconda 5.2 can be installed in both Python 3.6 and Python 2.7 versions on Windows, macOS, and Linux:

After you have finished installing, in order to test the installation, in Terminal or Anaconda Prompt, run the following command:

$ conda list

For a successful installation, a list of installed packages appears. As mentioned, Anaconda (and Miniconda) comes with conda, which is a simple package manager similar to apt-get on Linux. In this way, we can install new packages in Terminal using the following command:

$ conda install packagename

Here, packagename is the actual name of the package we want to install. Existing packages can be updated using the following command:

$ conda update packagename

We can also search for packages using the following command:

$ anaconda search –t conda packagename

This will bring up a whole list of packages available through individual users.
A package called packagename from a user called username can then be installed as follows:

$ conda install -c username packagename

Additionally, conda can be used to create and manage virtual environments. For example, creating a test environment and installing NumPy version 1.7 is as simple as typing the next command:

$ conda create --name test numpy=1.7

In a similar fashion as working with virtualenv, environments can be activated and deactivated. To do this on macOS and Linux, just run the following:

$ source activate test
$ python
...
$ source deactivate

On Windows, run the following:

$ activate test
$ python
...
$ deactivate
See the conda cheat sheet PDF (1 MB) for a single-page summary of the most important information about using conda: https://conda.io/docs/_downloads/conda-cheatsheet.pdf.

Finally, it should be pointed out that we can work with conda under the PyCharm IDE, in a similar way as virtualenv to create and manage virtual environments, because PyCharm can work with both tools.

主站蜘蛛池模板: 灵山县| 滨州市| 兴海县| 昭苏县| 白河县| 南城县| 克什克腾旗| 通辽市| 曲靖市| 清流县| 察隅县| 吴江市| 轮台县| 绍兴市| 阳西县| 墨玉县| 出国| 宜都市| 宁陕县| 三台县| 神农架林区| 阜康市| 福海县| 中超| 依安县| 彰化市| 仪征市| 青田县| 新安县| 双辽市| 建平县| 翼城县| 康平县| 丰台区| 奇台县| 武威市| 泸水县| 民权县| 泰来县| 大竹县| 进贤县|