python3.7安装
Posted 阳光很暖吧
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python3.7安装相关的知识,希望对你有一定的参考价值。
安装依赖
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 gcc libffi-devel
创建一个目录存放python3安装包,把python.tar包放到此目录下
mkdir /app
解压文件
tar -zxvf Python-3.7.1.tgz
进入目录二进制编译安装
cd Python-3.7.1/
安装目录为/usr/local/python3
./configure --prefix=/usr/local/python3
make
make install
尝试打开python程序
/usr/local/python3/bin/python3.7 退出 >>> exit()
ln -s /usr/local/python3/bin/python3 /usr/bin/python3 ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3 vim /etc/profile
最底部添加:
# 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
验证:
[root@filebeat python]# pip3 -V pip 10.0.1 from /usr/local/python3/lib/python3.7/site-packages/pip (python 3.7) [root@filebeat python]# python3 -V Python 3.7.1
完成
以上是关于python3.7安装的主要内容,如果未能解决你的问题,请参考以下文章