zoukankan      html  css  js  c++  java
  • centos7安装python3

    系统自带python2,通过annaconda3,使用python3:

    1. cd Downloads/
    2. wget https://repo.continuum.io/archive/Anaconda3-5.0.1-Linux-x86_64.sh
    3. chmod +x Anaconda3-5.0.1-Linux-x86_64.sh
    4. ./Anaconda3-5.0.1-Linux-x86_64.sh
    5. vim ~/.bashrc
        * append "export PATH=$PATH:$HOME/anaconda3/bin" at last   ## 设置环境变量时,新安装的anaconda3的地址最好放在最后,因为centos7有些系统服务会使用到系统自带的python2
    6. source ~/.bashrc

    if you are the 'root':
    7. do the above 1~5 steps
    8. vim /etc/profile
        * append "export PATH=$PATH:/root/anaconda3/bin" at last
    9. source ~/.bashrc
    10. cd /usr/bin
    11. ln -s /root/anaconda3/bin/python3.6 python3 ## 创建一个软连接,这样调用python3时,会启动anaconda内的程序
    12. chmod o+x /root

    then every user can use 'python3' directly

  • 相关阅读:
    Python生成器表达式
    Python列表解析
    Python迭代器(Iterator)
    Python set 集合
    python eval 函数妙用
    Python字典 (dict)
    Python序列之元组 (tuple)
    Python序列之列表 (list)
    递归和反射
    常用标准库
  • 原文地址:https://www.cnblogs.com/starRebel/p/8946239.html
Copyright © 2011-2022 走看看