安装和应用anaconda过程中的一些问题

anaconda切换镜像源操作后显示网络443错误

解决方法:切换镜像源的.condarc文件中所有链接,将https://改为http://
或者直接复制以下代码到.condarc文件中

channels:

show_channel_urls: true
default_channels:
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r/
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2/
custom_channels:
  conda-forge: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  msys2: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  bioconda: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  menpo: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch-lts: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  simpleitk: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud

anaconda navigator双击无法打开

解决方法1:升级navigator,执行conda update anaconda-navigator命令
解决方法2:切换其他网络或者断网(玄学),可能是因为电脑中有多个不同的Python版本

anaconda navigator打开时提示已经有存在的环境被打开

解决方法:
1.打开命令行窗口(win+R),输入CMD,回车
2.在cmd窗口输入命令语句:

tasklist|findstr “pythonw”

注意:只有findstr和"pythonw"间有一个空格
找到pythonw程序对应的编号(Console前面就是编号)
3.在cmd窗口输入命令语句:
taskkill /pid 编号 /f
将所有进程关闭
4.重新打开

anaconda常用命令

1.创建conda虚拟环境
通常安装anaconda后,会有一个base环境,但是通常在项目测试的时候不会使用这个,而是新创建一个环境。

conda create -n 环境名 python=版本号

2.激活环境

conda activate 环境名

3.查看已有环境列表

conda info --envs

4.查看当前环境中安装的包

conda list

5.退出当前环境

conda deactivate 环境名

6.删除不需要的环境

conda remove -n 环境名 --all

7.切换到默认环境

conda activate

8.克隆虚拟环境

conda create -n 新环境名称 --clone 旧环境名称

9.安装包

pip install 包名

或者指定镜像源安装

pip install 包名 -i https://pypi.tuna.tsinghua.edu.cn/simple/

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
THE END
分享
二维码
< <上一篇
下一篇>>