源码包安装Python3.6

源码编译
1133
linux
linux 举报
2020-05-18

1,安装Python3.6的依赖包

# 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

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

3.安装python3

创建目录:

# mkdir -p /usr/local/python3

  解压下载好的Python-3.x.x.tgz包(具体包名因你下载的Python具体版本不不同?而不不同,如:我下载的是Python3.6.1.那我这里就是Python-3.6.1.tgz)

# tar -zxvf Python-3.6.1.tgz

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

# cd Python-3.6.1

# ./configure --prefix=/usr/local/python3

# make && make install

5.建立python3的软链

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

6.并将/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

Python 3.6.1

# pip3 -V

pip 9.0.1 from /usr/local/python3/lib/python3.6/site-packages (python 3.6)


倒序看帖 只看楼主
热点关注
/lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
服务停止、启动、重启一体化脚本,万能语言启动脚本
shell参数判断
在后台用进程名运行bash脚本
shell脚本每行后面多了一个^M的原因和解决办法
定时检测服务,检测down掉后重启。系统检测到DMSERVER运行正常
挂载磁盘的时候遇到一个问题,挂载完磁盘之后重启服务器挂载的盘丢失了.
中标麒麟系统Your trial is EXPIRED and no VALID licens
termux 开启ssh并用用户名和密码登陆
组成共享库的目标文件和一般的目标文件有所不同,在编译时要加-fPIC和-share选项,例如:
gcc指定链接库路径后还是找不到库文件
./configure -build,-host,-target设置
shell脚本每行后面多了一个^M的原因和解决办法
shell 中 if [ “x${var}“ == “x“ ] 中 x的作用
查看linux机器是32位还是64位的方法