安装Tensorflow报错—UnavailableInvalidChannel


前言

由于在Anaconda Prompt中导入tensorflow包持续报错找不到模块,多番解决无果后卸载重装Anacnoda,在创建虚拟环境的时候出现报错,就此记录。

一、运行报错


执行新建python虚拟环境命令
conda create --name tensorflow python=3.5

出现报错,具体内容如下

UnavailableInvalidChannel: The channel is not accessible or is invalid.
channel name: anaconda/pkgs/free
channel url:https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
error code: 404
    
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.

二、原因及解决

重装时为了下载快,使用的镜像网址是清华大学的开源软件镜像站,网上搜到的原因是清华大学开源软件镜像站停止了对Anaconda的镜像服务,于是需要恢复默认源。

恢复默认源的命令如下:

conda config --remove-key channels

执行命令后再次创建虚拟环境,成功!

结果
对于黄色的警告,执行它的命令来升级一下。

总结

使用源的时候出现找不到源的报错可能是由于源网址停止服务或者网址错误导致的,恢复默认源即可解决。

猜你喜欢

转载自blog.csdn.net/weixin_47585015/article/details/110354984