ubuntu16安装anaconda3及卸载--Ubuntu

卸载:

(一)删除整个anaconda目录:

    由于Anaconda的安装文件都包含在一个目录中,所以直接将该目录删除即可。到包含整个anaconda目录的文件夹下,删除整个Anaconda目录:

    rm -rf anaconda文件夹名

(二)建议清理下.bashrc中的Anaconda路径:

   1.到根目录下,打开终端并输入:
      sudo gedit ~/.bashrc

   2.在.bashrc文件末尾用#号注释掉之前添加的路径(或直接删除):
      #export PATH=/home/lq/anaconda3/bin:$PATH
      保存并关闭文件

   3.使其立即生效,在终端执行:
      source ~/.bashrc

   4.关闭终端,然后再重启一个新的终端,这一步很重要,不然在原终端上还是绑定有anaconda.

安装:

bash ./Anaconda××××××××××××××××××.sh

安装完毕之后,可以用如下命令查看环境变量是否添加成功:

gedit ~/.bashrc

export PATH=/home/dsg/anconda3/bin:$PATH

新版的Anaconda会在每一个新开的terminal里面自动进入虚拟环境base,解决方法是用conda config命令:

conda config --set auto_activate_base false

换源

gedit ~/.condarc

然后:

channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/

ssl_verify: true
show_channel_urls: true

之后要更新conda:

conda update conda
开始自动更新,在process处选择y,让其继续更新,更新完再查看conda --version

注意:

没有defualt那句,是https不是http。

恢复默认源

conda config --remove-key channels

设置conda的超时时间

  1. conda config --set remote_connect_timeout_secs 40

  2. conda config --set remote_read_timeout_secs 100

pip 换源

若首次更换,则创建pip.conf文件(ubuntu系统):

    mkdir ~/.pip
    cd ~/.pip
    touch pip.conf

编辑pip.conf文件:

sudo gedit ~/.pip/pip.conf

打开pip.conf文件窗口,将以下内容复制到文件中:

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

删源

换回conda的默认源。查看了conda config的文档后,发现直接删除channels即可。

conda config --remove-key channels

ubuntu16.04启动Anaconda Navigator 图形化界面

 conda install -c anaconda anaconda-navigator​
 anaconda-navigator

安装jupyter notebook

pip install jupyter notebook

启动:jupyter notebook

问题

CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.

解决办法

# 激活环境
source activate
# 退出环境
source deactivate

 

创建虚拟环境并激活:

conda create -n edsr python=3.6
source activate edsr

列出所有环境

看看现在安装好了哪些环境,可以这么实现:

conda info --envs
 

 

 

 

 

 

 

 

 

 

  • 2
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

向阳+

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值