PS:如果本机安装了python2,尽量不要管他,使用python3运行python脚本就好,因为可能有程序依赖目前的python2环境,

比如yum!!!!!

不要动现有的python2环境!

1. 安装依赖环境

# yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel

2.下载Python3.4

# wget https://www.python.org/ftp/python/3.4.10/Python-3.4.10.tgz

3.安装Python3.4

  我安装到了 /usr/local/python3 (具体看你)

  创建目录

# mkdir -p /usr/local/python3

4.解压下载好的Python-3.4.10.tgz包

# tar -xvf Python-3.4..tgz

5. 进入解压后的目录,编译安装。

# cd Python-3.4./
# ./configure --prefix=/usr/local/python3

make

# make

make install

# make install

6.建立python3的软链

# ln -s /usr/local/python3/bin/python3 /usr/bin/python3

7.并将/usr/local/python3/bin加入PATH

# vim ~/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin:/usr/local/python3/bin
export PATH

 按ESC,输入:wq回车退出。

 修改完记得执行行下面的命令,让上一步的修改生效:

# source ~/.bash_profile

检查Python3及pip3是否正常可用:

# python3 -V

最新文章

  1. Java虚拟机详解----JVM常见问题总结
  2. 柯里化/偏函数/Curring用法
  3. LeetCode Weekly Contest 8
  4. gtk+-3.21.4 static build step in windows XP
  5. 《精通Linux内核必会的75个绝技》知识杂记
  6. java 多线程7(线程的停止)
  7. android中ListView控件&&onItemClick事件中获取listView传递的数据
  8. repeater 分页显示数据
  9. MYSql和PHP计算数据性能
  10. 从UUID想到的
  11. Redis in Python:HyperLogLog(pfadd、pfcount、pfmerge)
  12. rocketmq广播消息
  13. mysqli_query($conn, $sql)的返回值类型
  14. Confluence 6 数据库表和参考
  15. node-express根据请求,判断PC和移动端
  16. 能判断是电脑端还是手机端的javascript
  17. 通过HTTP参数污染绕过WAF拦截 (转)
  18. win10 切换网卡的bat
  19. crt,excrt学习总结
  20. 白盒测试实践项目(day6)

热门文章

  1. python基础修改haproxy配置文件
  2. ES Templates push
  3. HTML5全屏背景视频与 CSS 和 JS(插件或库)
  4. java反序列化-ysoserial-调试分析总结篇(2)
  5. C++走向远洋——50(Time类中的运算符重载、一目,二目比较运算符、二目赋值运算符、二目加减法运算符)
  6. 01 Taro_Mall 开源多端小程序框架设计
  7. handlebar.js模板引擎(轻页面小工程可用)
  8. 使用Blazor Server 线路处理程序 (circuit handler)跟踪打开的SignalR连接
  9. 有史以来最全的CMD命令
  10. Git将文件上传至Github过程