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

和自甴很熟 提交于 2020-01-06 05:30:18

问题


I am trying to install a specific version of awscli within my conda environment (running python 3.6). I have tried adding conda-forge to my current channels, as suggested in another post.

When I run the command conda install -p /Users/myname/anaconda3/envs/py36 awscli==1.11.156 -y

It errors with this message:

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

回答1:


Quoting from conda miths and misconceptions by Jake VanderPlas:

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.

You can try to activate your virtual environment and just install it using any of the standard methods. Supposing you have created a conda virtual environment named py36:

$ source activate py36

Or on Windows

> activate py36

Then you just use any of the standard install methods, for example:

$ pip install awscli==1.11.156

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

The downside is that conda is not managing dependencies for packages installed using pip but in most cases it is OK.



来源:https://stackoverflow.com/questions/49162142/how-to-install-specific-awscli-version-in-conda-env-running-3-6-when-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!