无法在Anaconda虚拟环境中安装软件包.“当前频道无法提供套餐" [英] Unable to install packages in Anaconda virtual environment. 'Packages are not available from current channels'
问题描述
我正在尝试在Anaconda中创建一个新的Python环境.我正在使用Anaconda Powershell Prompt,并使用
I am trying to create a new Python environment in Anaconda. I am using Anaconda Powershell Prompt and created the environment using the
conda create --name adwp1 python=3.5 -y;
conda activate adwp1
conda install notebook=4.2.3 -y;
和
pip install notebook = 4.2.3
使用 conda install
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
PackagesNotFoundError: The following packages are not available from current channels:
- notebook=4.2.3
Current channels:
- https://repo.anaconda.com/pkgs/main/win-64
- https://repo.anaconda.com/pkgs/main/noarch
- https://repo.anaconda.com/pkgs/r/win-64
- https://repo.anaconda.com/pkgs/r/noarch
- https://repo.anaconda.com/pkgs/msys2/win-64
- https://repo.anaconda.com/pkgs/msys2/noarch
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
,然后使用页面顶部的搜索栏.
and use the search bar at the top of the page.
**,当我使用** pip install
时,出现以下错误
**and when I use ** pip install
then I get the following error
错误:无效的要求:'notebook = 4.2.3'提示:=无效操作员.你是说==吗?
ERROR: Invalid requirement: 'notebook=4.2.3' Hint: = is not a valid operator. Did you mean == ?
推荐答案
该版本的软件包在官方存储库中不可用,因此您必须从其他地方安装它.幸运的是,这可以在 conda-forge
用户维护的存储库中找到.如果您信任软件包的维护者,则只需执行以下操作即可:
That version of the package is not available in the official repositories, so you have to install it from somewhere else.
Luckily, this is available in the conda-forge
user-maintained repositories.
If you trust the maintainer of the package, you can simply do:
conda install -c conda-forge -y notebook=4.2.3
编辑
EDIT
As per @merv comment, it may also be possible to get this package by restoring the free channel searching, which can be done essentially by setting to 1
the CONDA_RESTORE_FREE_CHANNEL
environment variable:
CONDA_RESTORE_FREE_CHANNEL=1 conda install -y notebook=4.2.3
或通过将相应的配置标志设置为 true
:
or by setting the corresponding config flag to true
:
conda config --set restore_free_channel true
就 pip
命令而言,这只是一个错字(如错误消息中所建议):将 =
替换为 ==
应该可以解决问题:
As far as the pip
command is concerned, this is simply a typo (as suggested in the error message): replacing =
with ==
should do the trick:
pip install notebook==4.2.3
这篇关于无法在Anaconda虚拟环境中安装软件包.“当前频道无法提供套餐"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!