Ubuntu16.04下Anaconda3的安装与卸载

第一种安装anaconda的做法

参考 https://blog.csdn.net/u012243626/article/details/82469174
1.清华大学开源软件镜像站下载地址: https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/
2.在Downloads文件中单击鼠标右键,Open in Terminal,在Terminal中执行以下命令:
bash Anaconda3-4.2.0-Linux-x86_64.sh
3.按回车键继续安装;
4.按回车键键阅读注册信息;
5.阅读完注册信息后,输入“yes”回车继续;
6.按回车键确认安装位置 /home/{虚拟机名称}/anaconda3 ;
7.输入“yes”选择添加环境变量;
8.当你出现类似界面:
证明Anaconda3已安装成功,输入“no”取消安装 VSCode,因为我们后续将会安装PyCharm作为IDE。
9.命令行输入spyder

安装之后出现的问题

1,spyder的ipython console无法选中复制文字
2,无法进行Tab输入
3,opencv安装困难,conda install不能装,pip install可以装上
反复按照上述方法装了几次还是出现这种问题

卸载Anaconda

参考:https://blog.csdn.net/ytusdc/article/details/84985375

1、删除整个anaconda目录:

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

rm -rf Anaconda3安装路径

2、清理下.bashrc中的Anaconda路径:

打开终端并输入:

sudo gedit ~/.bashrc

在.bashrc文件末尾,删除掉Anaconda3写入的东西

# added by Anaconda3 5.3.1 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/home/vision/Softwares/Anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
    \eval "$__conda_setup"
else
    if [ -f "/home/vision/Softwares/Anaconda3/etc/profile.d/conda.sh" ]; then
        . "/home/vision/Softwares/Anaconda3/etc/profile.d/conda.sh"
        CONDA_CHANGEPS1=false conda activate base
    else
        \export PATH="/home/vision/Softwares/Anaconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda init <<<

保存并关闭文件

3.使其立即生效,在终端执行:

source ~/.bashrc

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

参考:https://www.cnblogs.com/mar-q/p/7490271.html
首先要找到当初安装opencv sourcecode的build目录(如果不明白什么是build目录可以先跳过这一步,看第3步.),进入该build目录执行如下操作:

sudo make uninstall
cd ..
sudo rm -r build
rm -r /usr/local/include/opencv2 /usr/local/include/opencv /usr/include/opencv /usr/include/opencv2 /usr/local/share/opencv /usr/local/share/OpenCV /usr/share/opencv /usr/share/OpenCV /usr/local/bin/opencv* /usr/local/lib/libopencv*

删除/usr中所有opencv相关项

cd /usr/
find . -name "*opencv*" | xargs sudo rm -rf

移除Python相关

apt-get remove opencv-doc opencv-data python-opencv

第二种安装anaconda的做法

参考:
https://blog.csdn.net/aaon22357/article/details/81913465
https://blog.csdn.net/lwplwf/article/details/79162470
1.下载Anaconda

地址:https://www.anaconda.com/download/#linux
2.安装

进入安装包所在目录,执行命令:

$ bash Anaconda3-5.0.1-Linux-x86_64.sh

3.再执行命令让.bashrc中添加的路径生效:

$ source ~/.bashrc

4.运行python就可以看到已经安装好了,执行$ which python命令可以查看python路径。

安装中出现的可疑问题
Do you wish the installer to initialize Anaconda3
by running conda init? [yes|no]
[no] >>> yes
WARNING: The conda.compat module is deprecated and will be removed in a future release.
no change     /home/ubuntu/anaconda3/condabin/conda
no change     /home/ubuntu/anaconda3/bin/conda
no change     /home/ubuntu/anaconda3/bin/conda-env
no change     /home/ubuntu/anaconda3/bin/activate
no change     /home/ubuntu/anaconda3/bin/deactivate
no change     /home/ubuntu/anaconda3/etc/profile.d/conda.sh
no change     /home/ubuntu/anaconda3/etc/fish/conf.d/conda.fish
no change     /home/ubuntu/anaconda3/shell/condabin/Conda.psm1
no change     /home/ubuntu/anaconda3/shell/condabin/conda-hook.ps1
no change     /home/ubuntu/anaconda3/lib/python3.7/site-packages/xonsh/conda.xsh
no change     /home/ubuntu/anaconda3/etc/profile.d/conda.csh
modified      /home/ubuntu/.bashrc

==> For changes to take effect, close and re-open your current shell. <==

If you'd prefer that conda's base environment not be activated on startup, 
   set the auto_activate_base parameter to false: 

conda config --set auto_activate_base false

Thank you for installing Anaconda3!

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

Anaconda and JetBrains are working together to bring you Anaconda-powered
environments tightly integrated in the PyCharm IDE.

PyCharm for Anaconda is available at:
https://www.anaconda.com/pycharm

(没管)
安装之后解决了上一中安装之后遇到的无法选中复制文字以及无法Tab问题!!
可能原因是这个安装包比较好??

  • 5
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值