ubuntu16.04安装anaconda和改pip、conda源

本文详细介绍了如何从清华源下载并安装Anaconda,并提供了避免使用sudo权限的建议。同时,文章还指导读者如何修改pip和conda的源,以提高国内用户安装软件包的速度。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1、ancanda下载

下载地址:

源地址:https://repo.anaconda.com/archive/

清华源的下载地址(推荐):https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/

python3.6的对应的是 Anaconda 5.2,

Anaconda 5.3以后的都是python 3.7的不要看错了

2、安装

千万不要sudao bash Anaconda3-5.2.0-Linux-x86_64.sh ,sudo权限太高了,对以后使用特麻烦。

bubble@bubble:~/Downloads/service$ bash Anaconda3-5.2.0-Linux-x86_64.sh 

Welcome to Anaconda3 5.2.0

In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
>>> 


Do you accept the license terms? [yes|no]
[no] >>> yes

Anaconda3 will now be installed into this location:
/home/bubble/anaconda3

  - Press ENTER to confirm the location
  - Press CTRL-C to abort the installation
  - Or specify a different location below

[/home/bubble/anaconda3] >>> 
PREFIX=/home/bubble/anaconda3
installing: python-3.6.5-hc3d631a_2 ...
Python 3.6.5 :: Anaconda, Inc.
.......
installing: anaconda-5.2.0-py36_3 ...
installation finished.
Do you wish the installer to prepend the Anaconda3 install location
to PATH in your /home/bubble/.bashrc ? [yes|no]
[no] >>> yes

Appending source /home/bubble/anaconda3/bin/activate to /home/bubble/.bashrc
A backup will be made to: /home/bubble/.bashrc-anaconda3.bak


For this change to become active, you have to open a new terminal.

Thank you for installing Anaconda3!

===========================================================================

Anaconda is partnered with Microsoft! Microsoft VSCode is a streamlined
code editor with support for development operations like debugging, task
running and version control.

To install Visual Studio Code, you will need:
  - Administrator Privileges
  - Internet connectivity

Visual Studio Code License: https://code.visualstudio.com/license

Do you wish to proceed with the installation of Microsoft VSCode? [yes|no]
>>> no

3、修改pip和conda源

3.1 pip源

打开一个终端(快捷键ctrl+alt+T),在终端中分别输入下面两行内容,即在~/路径下创建.pip文件夹和在~/.pip/pip.conf文档

mkdir ~/.pip  
touch ~/.pip/pip.conf
gedit ~/.pip/pip.conf

在弹出的文档编辑器里面输入下面内容后保存关闭就可以了:

[global]  
index-url = https://mirrors.aliyun.com/pypi/simple/   
[install]  
trusted-host=mirrors.aliyun.com

将pip的源改成国内的阿里源,以后使用pip安装包速度就会快飞一般的感觉。

3.2 conda源

打开新的终端或者使用刚才的终端,输入下面命令:

touch ~/.condarc
gedit ~/.condarc

在跳出来的文档编辑器中输入粘贴下面内容后保存退出

channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  - defaults
show_channel_urls: true

现在pip和conda的源都配置成国内的源了

 

Error集:

1、

[/home/bubble/anaconda3] >>>

PREFIX=/home/bubble/anaconda3

WARNING: md5sum mismatch of tar archive

expected: d872e1a556042afcd3b5159c917ab170

got: fdc45df27dcd58d8584ec3738e06e826 -

tar: Skipping to next header

tar: A lone zero block at 818701

tar: Exiting with failure status due to previous errors

ERROR: could not extract tar starting at line 752

 

出现这种情况是因为传输或者拷贝文件过程中损坏文件,你只要重新下载就好了

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值