Ubuntu16.04环境下Python开发环境配置——包管理工具Anaconda3

一、Anaconda3的下载

    前往Anaconda3的下载网址,如果是64bit的x86操作系统架构,请按照下图选择64-Bit (x86) Installer (551 MB) ;


二、对Anaconda3进行安装

     使用网页链接对Anaconda3下载完成后默认存在~/Download文件下。如果不确认存储位置的话,可使用find命令在~路径下查看一下文件位置

yuhuiliu@sinc-server:~/tools$ find ~ -name "*Ana*"
/home/yuhuiliu/文档/Anaconda3-5.1.0-Linux-x86_64.sh
find: `/home/yuhuiliu/.cache/dconf': 权限不够

    对Anaconda3进行安装:

yuhuiliu@sinc-server:~/tools$ sudo sh ~/文档/Anaconda3-5.1.0-Linux-x86_64.sh

Welcome to Anaconda3 5.1.0

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

    按照提示,输入Enter,接下来,它会提示你是否接受协议,这里直接输入yes,再按回车即可(不要直接按回车,这样默认是no),

Do you accept the license terms? [yes|no]
[no] >>>
Please answer 'yes' or 'no':'
>>>
     继续按照提示操作,这里问你是否需要为Anaconda配置环境变量,如果这里选择no,需要到安装完成的Anaconda3/bin目录下才能执行Anaconda以及其他附属命令。
installation finished.
Do you wish the installer to prepend the Anaconda3 install location
to PATH in your /home/yuhuiliu/.bashrc ? [yes|no
    如果Anaconda的版本比较新的话(5.1以上),在安装完成后会提示你是否需要安装Microsoft的VSCode这款编辑工具,为了懒得再配置(折腾)其他编辑器,一般我这里选择yes安装VSCode。
Do you wish to proceed with the installation of Microsoft VSCode? [yes|no]
>>> yes

三、验证Anaconda是否配置好

    在命令行输入python命令:

yuhuiliu@sinc-server:~$ python
Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 18:10:19)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

    如上图的结果所示 ,python环境已经自动由Anaconda进行托管,以后就再也不用担心python的包依赖问题啦~

四、Anaconda换源、更新

    

    对anaconda换源,更换成清华的源:

yuhuiliu@sinclab-desktop:~$  conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

    设置显示源地址:

yuhuiliu@sinclab-desktop:~$ conda config --set show_channel_urls yes

   使能condrc文件:

yuhuiliu@sinclab-desktop:~$ source ~/.condarc

    更新conda自己:

yuhuiliu@sinclab-desktop:~$ conda update conda
     更新所有库:
yuhuiliu@sinclab-desktop:~$ conda update --all

猜你喜欢

转载自blog.csdn.net/vslyu/article/details/80270191