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

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.

主站蜘蛛池模板: 靖江市| 土默特左旗| 灵丘县| 榆社县| 广宁县| 石嘴山市| 拉萨市| 闻喜县| 乌鲁木齐市| 巴马| 天峻县| 集贤县| 西丰县| 海城市| 恭城| 潼南县| 禹州市| 孙吴县| 淳化县| 凤凰县| 高唐县| 马边| 马鞍山市| 衡水市| 肇庆市| 博爱县| 景洪市| 射阳县| 靖远县| 蕲春县| 太白县| 泊头市| 泌阳县| 兴山县| 丹凤县| 仪征市| 芜湖县| 宜宾县| 伊金霍洛旗| 晋江市| 昌平区|