首页 > 系统相关 >Linux安装Miniconda和换源

Linux安装Miniconda和换源

时间:2023-05-25 16:23:24浏览次数:50  
标签:cn mirrors anaconda Miniconda conda https Linux edu 换源

1. Miniconda简介

相比于Anaconda的臃肿,使用Miniconda是个不错的选择,Miniconda是一款小巧的python环境管理工具,安装包大约只有50M多点,其安装程序中包含conda软件包管理器和Python。

2. Miniconda下载

  • 官方下载
https://docs.conda.io/en/latest/miniconda.html

image-20230523173042531

  • 清华镜像下载(推荐)
https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/

清华镜像源

3. 安装教程

安装过程一路回车,yes,安装过程中根据提示输入enter或yes

  • 国外官方源
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-py39_4.9.2-Linux-x86_64.sh
  • 国内清华镜像
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py39_4.9.2-Linux-x86_64.sh
bash Miniconda3-py39_4.9.2-Linux-x86_64.sh

image-20230523171520061

image-20230523171612308

image-20230523171634688

安装完成后,验证安装是否成功

conda -V

image-20230523173454708

如果输出了

image-20230523173512092

解决办法:

source /root/miniconda3/bin/activate

此时你就进入base环境,conda deactivate 退出base环境之后就能正常使用conda指令了。

这里可能会不一样,/root/miniconda3需要改成你自己的安装路径,我这里的安装路径是/root/miniconda3

image-20230523172034721

**如果不想进入终端默认激活base环境: **

conda config --set auto_activate_base false

4. Conda配置国内镜像源

# 换回默认源(清除所有用户添加的镜像源路径,只保留默认的路径)
conda config --remove-key channels
vim ~/.condarc

4.1.condarc文档内容如下(清华镜像源):

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

4.2 其他的镜像源

# 中科大镜像源
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/menpo/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/

# 阿里镜像源
conda config --add channels https://mirrors.aliyun.com/pypi/simple/

# 豆瓣的python的源
conda config --add channels http://pypi.douban.com/simple/ 

# 显示检索路径,每次安装包时会将包源路径显示出来
conda config --set show_channel_urls yes
conda config --set always_yes True

#执行以下命令清除索引缓存,保证用的是镜像站提供的索引
conda clean -i

# 显示所有镜像通道路径命令
conda config --show channels

5. 参考资料

  1. 清华镜像:https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/
  2. Miniconda官网;https://docs.conda.io/en/latest/miniconda.html
  3. Conda配置国内镜像源
  4. Miniconda软件安装教程(Linux)
  5. https://www.cnblogs.com/on-the-way-w/p/14549512.html

标签:cn,mirrors,anaconda,Miniconda,conda,https,Linux,edu,换源
From: https://www.cnblogs.com/Oraer/p/17431614.html

相关文章

  • 【linux】记一次linux开机黑屏卡死排查
    背景:机器:红帽7.6问题:在安装docker后挂载盘后重启黑屏无法启动 排查过程:1、进入单用户模式2、排查发现fstable挂载有误,一个个判断是哪个磁盘挂载有误3、发现挂载没问题,但是一挂载上就无法启动4、尝试修改挂载路径,问题解决 问题根源:原先挂载路径中有程序被设置为开机自......
  • 走进Linux世界,学习Linux系统的必备指南
    随着计算机技术的不断发展,Linux操作系统已成为IT行业中备受关注的操作系统之一。Linux以其安全性、稳定性和开放性,受到了广泛的认可和欢迎。学习Linux系统对于IT行业的从业者来说是非常重要的。但是,对于初学者来说,学习Linux可能会感到有些困难。所以,我今天我打算给初学者们答疑解惑......
  • Linux (6) 磁盘扩容
    《WindowsAzurePlatform系列文章目录》 #先格式化磁盘sudosu-fdisk-lmkfs.xfs/dev/sdbblkidvi/etc/fstabUUID=4329a75b-ac40-4145-b0d5-1007e298b7ef/dataxfsdefaults,nofail00mkdir/datamount-adf-h#再扩容磁盘sud......
  • 【linux】linux设置开机自启动的几种方式
     一.、在/etc/rc.local文件中添加自启动命令执行命令:编辑"/etc/rc.local",添加你想开机运行的命令运行程序脚本:然后在文件最后一行添加要执行程序的全路径。例如,每次开机时要执行一个hello.sh,这个脚本放在/usr下面,那就可以在"/etc/rc.local"中加一行"/usr/./hello.s......
  • linux productuuid计算机唯一标识符查看
    目录linuxproductuuid计算机唯一标识符查看在Windows操作系统中查看ProductUUID:在macOS操作系统中查看ProductUUID:在Linux操作系统中查看ProductUUID:两台机器上的uuid可能会冲突吗linuxproductuuid计算机唯一标识符查看"ProductUUID"是指计算机的唯一标识符(UUID),它是......
  • Rocky Linux 9 x86_64 OVF (sysin)
    RockyLinux9x86_64OVF(sysin)以社区方式驱动的企业Linux请访问原文链接:https://sysin.org/blog/rocky-linux-9-ovf/,查看最新版。原创作品,转载请保留出处。作者主页:sysin.orgRockyLinux9.0(5.14.0-70.13.1.el9_0.x86_64)以社区方式驱动的企业LinuxRockyLinux是......
  • linux 清空文件内容命令
    1.使用vi/vim命令打开文件后,输入"%d"清空,后保存即可。但当文件内容较大时,处理较慢,命令如下:vimfile_name:%d:wq2.使用cat命令情况,命令如下:cat/dev/null>file_name3.使用echo命令清空,此时会在文件中写入一个空行“\n",命令如下:echo"">file_name4.清空>file_name......
  • dockerfile中安装miniconda
    要在Dockerfile中安装Miniconda,你可以按照以下步骤进行操作:1.在Dockerfile中选择一个基础映像作为你的基础操作系统。例如,你可以选择一个适合的Linux发行版,如Ubuntu或CentOS。2.在Dockerfile中添加安装Miniconda的命令。可以使用以下示例命令:```dockerfile#设......
  • LINUX系列-命令篇
    1find命令-name名称查找-size大小查找-type类型查找f:普通文件d:目录文件l:链接文件b:块设备文件c:字符设备文件p:管道文件s:socket文件-user属性查找-iname忽略大小写查找-[cam]time(create/access/modify)时间查找-maxdepth深度查找-exec执行动作#......
  • How to change the default Python2 to Python3 on Linux All In One
    HowtochangethedefaultPython2toPython3onLinuxAllInOneRaspberryPi在Linux中如何把默认的Python2更改为Python3solutions.bashrc/.zshrcalias$sudovim.bashrc$cat.bashrc$cat.bashrc|greppy#.bashrc配置一个alias✅#Python3=......