程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Linux Installation python3.6 x

編輯:Python

Linux install Python3.6.x

Installation required on recent projects python Environmental Science , This blog is mainly about recording installation and introducing installation Python3.6.x The process of , It includes the following process :

(1) install python Depend on the environment

 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
yum install gcc
Be careful : If installed python3.7.x Version of python, Need to install yum install libffi-devel -y

(2) Download the specified version of 3.6.x Of python

 Download the offline package or online package in advance , for example wget https://www.python.org/ftp/python/3.6.8/Python-3.6.8.tgz
Be careful : If installed tensorflow,torch Equal module , Don't suggest python3.6.1 edition

(3) Unzip downloaded python

 for example :tar -zxvf Python-3.6.8.tgz

(4) Create installation python The installation directory

 for example , Installed in the /usr/local/python3 Under the table of contents , Create installation directory mkdir -p /usr/local/python3

(5) Compilation and installation python

 Get into python Unzipped directory , for example :
cd Python-3.6.8
Input ./configure --prefix=/usr/local/python3
Compile input make
install make install

(6) Check python Interpreter

 Input :/usr/local/python3/bin/python3.6
Output python Version of

(7) Create a soft connection

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

(8) Add environment PATH

 vim /etc/profile
Enter the following :
# 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
preservation :wq
And then let the previous modification take effect :source ~/.bash_profile

(9) Check Python3 And pip3 Is it working properly :

 python3 -V
pip3 -V

Be careful :arm64 Architecture installation python And linux install python The steps are the same

 (7)(8)(9) The steps shall be determined according to the actual situation

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved