在当前频道中找不到时如何在 conda env (运行 3.6) 中安装特定的 awscli 版本

How to install specific awscli version in conda env (running 3.6) when not found in current channels

我正在尝试在我的 conda 环境中安装特定版本的 awscli (运行ning python 3.6)。我已经尝试将 conda-forge 添加到我当前的频道,正如另一个 post.

中所建议的

当我运行命令conda install -p /Users/myname/anaconda3/envs/py36 awscli==1.11.156 -y

此消息出错:

Solving environment: failed

PackagesNotFoundError: The following packages are not available from current channels:

  - awscli==1.11.156

Current channels:

  - https://repo.continuum.io/pkgs/main/osx-64
  - https://repo.continuum.io/pkgs/main/noarch
  - https://repo.continuum.io/pkgs/free/osx-64
  - https://repo.continuum.io/pkgs/free/noarch
  - https://repo.continuum.io/pkgs/r/osx-64
  - https://repo.continuum.io/pkgs/r/noarch
  - https://repo.continuum.io/pkgs/pro/osx-64
  - https://repo.continuum.io/pkgs/pro/noarch
  - https://conda.anaconda.org/conda-forge/osx-64
  - https://conda.anaconda.org/conda-forge/noarch

引自 Jake VanderPlas 的 conda miths and misconceptions

If all you are doing is installing Python packages within an isolated environment, conda and pip+virtualenv are mostly interchangeable, modulo some difference in dependency handling and package availability. By isolated environment I mean a conda-env or virtualenv, in which you can install packages without modifying your system Python installation.

您可以尝试激活您的虚拟环境,然后使用任何标准方法安装它。假设您已经创建了一个名为 py36 的 conda 虚拟环境:

$ source activate py36

或 Windows

> activate py36

然后您只需使用任何标准安装方法,例如:

$ pip install awscli==1.11.156

$ easy_install https://github.com/aws/aws-cli/archive/1.11.156.tar.gz

缺点是 conda 不管理使用 pip 安装的包的依赖关系,但在大多数情况下是可以的。