最近的一些工作要用到scikit-image包,pip一直安装不成功,就用conda环境安装,简单记录下安装的过程。
- 首先进入要安装\包的环境,具体操作可参考之前的文章。
- 尝试安装scipy,遇到问题(Conda 无法找到所需的 scikit-image 渠道)
(Pytorch) C:\Users\user>conda install -c anaconda scipy
Collecting package metadata (current_repodata.json): failed
UnavailableInvalidChannel: HTTP 404 NOT FOUND for channel scikit-image <https://conda.anaconda.org/scikit-image>
The channel is not accessible or is invalid.
You will need to adjust your conda configuration to proceed.
Use `conda config --show channels` to view your configuration's current state,
and use `conda config --show-sources` to view config file locations.
- 查看conda配置状态
conda config --show channels
结果为:
(Pytorch) C:\Users\user>conda config --show channels
channels:
- conda-forge
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
- scikit-image
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/peterjc123/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch
- defaults
看起来 Conda 渠道配置包含了一些镜像源以及一些特定的渠道。
现在可以按照以下步骤操作:
- 检查渠道配置,看看是否有无效或错误的渠道。在这里,似乎
scikit-image
渠道可能无效,因为在安装scipy
时遇到了问题。可以使用以下命令删除它:
conda config --remove channels scikit-image
- 添加正确的渠道:确保有 PyTorch 渠道,如果没有,可以手动添加:
conda config --add channels pytorch
- 再次运行安装命令:
conda install -c anaconda scipy
- scikit-image包也是如上安装方法
-
conda install -c conda-forge scikit-image