快速入门 (AER 2.29)

查找、下载和安装软件包

搜索包

您不需要 Anaconda Repository 帐户,甚至不需要登录,即可搜索软件包、笔记本、环境或安装程序,以及下载和安装它们。

您确实需要一个帐户才能在没有访问令牌的情况下 访问 私有软件包、上传您自己的软件包或与他人共享您的软件包、笔记本、环境和安装程序。

  1. 在顶部的搜索框中,键入您要搜索的文件的部分或全部名称,然后按 Enter。
  2. 显示与您的搜索字符串匹配的包。单击名称以查看更多信息。
../../../_images/anaconda-repository/2.29/anaconda-repo-search.png

优化您的搜索结果

您可以使用三个过滤器控件过滤搜索结果:

  • 所有包,仅 conda 或仅 PyPI
  • 所有类型,公共和/或私人(仅在您登录后可用)
  • 平台:全部、源代码、Linux-32、Linux-64、Noarch、OSX-64、Win-32、Win-64。

“源”包只是源代码,尚未为任何特定平台构建。

“Noarch”软件包可在所有平台上运行。

下载并安装软件包

您可以使用 Anaconda Navigator(Anaconda Repository 的图形用户界面)下载和安装软件包。高级用户可能更喜欢终端窗口或命令提示符。两者都包含说明。

使用 Anaconda 导航器

安装 Anaconda 时会自动安装 Anaconda Navigator。通过单击桌面上或程序菜单中的程序图标来启动Navigator

首先,设置 Navigator 以搜索您本地的 Anaconda 存储库。从顶部菜单栏中,选择首选项。在“Anaconda API 域”框中,输入您本地 Anaconda 存储库的地址,然后单击“应用”按钮:

../../../_images/anaconda-repository/2.29/anaconda-repo-local.png

注意:如果您的组织不使用 HTTPS,请键入 HTTP 并取消选中下一个框“启用 SSL 验证”。

注意:如果您的组织使用子域,请输入如下地址:https://api.<your-anaconda-repo>:8080。如果失败,请与您的管理员联系。

接下来,将 Navigator 登录到您本地的 Anaconda Cloud(Anaconda 存储库),以便您可以搜索标记为私有的包。单击右上角的“登录 Anaconda Cloud”按钮并输入您的 Anaconda Repository 用户名和密码,然后单击“应用”按钮:

../../../_images/anaconda-repository/2.29/anaconda-repo-navigator-signin.png

Download and install a package into its own environment from your Environments tab: from the far right “Search packages” box enter the name of the package. Be sure to select either “not installed” or “all” from the drop-down menu, then click the Search button. Check the checkbox of the package you want to install and click the Apply button. See Navigator for more detailed information.

Using conda in a terminal window or command prompt

After you have located a package on Anaconda Repository and clicked on the name, the detail page displays specific install instructions for the current operating system. Copy and paste the full command into your terminal window.

NOTE: For the following examples to work, you need to have conda downloaded and installed.

EXAMPLE: To download and install a package with conda, run:

conda install -c username packagename

TIP: Conda automatically expands the “username” to a URL such as https://<your-anaconda-repo>/username.

Build and upload new packages

Building and uploading new packages is optional for advanced users who are comfortable using a Terminal application.

To build and upload packages, install the Anaconda Client command line interface (CLI). Open a Terminal window and enter:

conda install anaconda-client

Next, still in your Terminal window, log into your Anaconda Repository account:

anaconda login

At the prompt, enter your Anaconda Repository username and password.

Next, choose the package you would like to build. For this quickstart, you can download our public test package:

git clone https://github.com/Anaconda-Server/anaconda-client
cd anaconda-client/example-packages/conda/

To build your test package, first install conda-build and turn off automatic anaconda-client uploading, then run the conda build command:

conda install conda-build
conda config --set anaconda_upload no
conda build .

Check your path to where the newly-built file was placed so you can use it in the next step:

conda build . --output

Finally, still in your Terminal window, if you haven’t already log into your Anaconda Repository account, then upload your newly-built test package:

anaconda login
anaconda upload /your/path/conda-package.tar.bz2

For detailed information, see the Conda packages section.

Share notebooks

Upload a Jupyter notebook (formerly IPython notebook) to Anaconda Repository:

anaconda upload my-notebook.ipynb

笔记本的 HTML 版本将位于:

http://notebooks.anaconda.org/<用户名>/my-notebook

任何有权访问 Anaconda Repository 的人都可以下载它:

anaconda 下载用户名/我的笔记本

共享环境

保存conda 环境并将其上传到 Anaconda Repository:

conda env export -n my-environment -f my-environment.yml
anaconda 上传 my-environment.yml

您上传的环境列表位于:

http://envs.<anaconda-repo-name>/<USERNAME>

任何人都可以从 Anaconda Repository 下载并安装您的环境:

conda env 创建用户/我的环境
源激活我的环境