1. Basic information
Version |
2.7.5 |
Installing the Machine |
Three machines |
Account |
Root |
Source Path |
/opt/software/python-2.7.8.tar.gz |
Target path |
/opt/python-/opt/python2.7 |
Dependent relationships |
No |
2. Installation process
1). Using the root account, extract the Python package into the/opt/directory:
[root @bgs -5p173-wangwenting opt]# cd /opt/software [root @bgs -5p173-wangwenting opt]# tar -zxvf Python-${version}tar.gz -C /opt [root @bgs -5p173-wangwenting opt]# ln -s /opt/Python-${version} /opt/Python |
2). Setting up a soft connection
[root @bgs -5p173-wangwenting opt]# ln -s /opt/Python-${version} /opt/Python |
3). Add the Dynamic Connection library path and make it effective:
[root @bgs -5p173-wangwenting opt]# vim /etc/ld.so.conf [root @bgs -5p173-wangwenting opt]# ldconfig |
4). Set the environment variables that Python runs:
[root @bgs -5p173-wangwenting opt]# vi /etc/profile [root @bgs -5p173-wangwenting opt]# ldconfig #添加下面的类容 # export PATH=/opt/Python/bin:$PATH #使环境变量生效 # source /etc/profile |
5). Execute Python:
[root @bgs -5p173-wangwenting opt]# python |
Execute python-v, if the display version is the Python version of the installation, indicates that the Python installation was successful.
2. Offline installation of Python on Linux