注意:
python27 默认没有安装 pip 和setuptools所以要提前安装。(务必先提前安装python27 哈 )
wget --no-check-certificate https://bootstrap.pypa.io/ez_setup.py python ez_setup.py --insecure wget https://pypi.python.org/packages/11/b6/abcb525026a4be042b486df43905d6893fb04f05aac21c32c638e939e447/pip-9.0.1.tar.gz#md5=35f01da33009719497f01a4ba69d63c9 tar -xf pip-9.0.1.tar.gz cd pip-9.0.0 python setup.py install ln -s /usr/local/python27/bin/pip /usr/bin/pip
安装python2.7
188 2019-06-15 16:47:21 https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tar.xz 189 2019-06-15 16:47:39 wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tar.xz 190 2019-06-15 17:05:58 ls 191 2019-06-15 17:06:11 xz -d Python-2.7.10.tar.xz 192 2019-06-15 17:06:20 tar -xf Python-2.7.10.tar 193 2019-06-15 17:06:25 cd Python-2.7.10/ 194 2019-06-15 17:06:44 ./configure --prefix=/python27 195 2019-06-15 17:08:00 make &&make install 196 2019-06-15 17:14:07 ./configure --prefix =/opt/python27 197 2019-06-15 17:14:30 ./configure --prefix=/opt/python27 198 2019-06-15 17:16:02 make && make install
204 2019-06-15 17:16:55 ln -s /opt/python27/bin/python2 /usr/local/bin/python2
205 2019-06-15 17:17:12 vim /etc/profile
206 2019-06-15 17:17:17 vim /etc/profile
在最底行写入 export PATH=$PATH:/opt/python347/bin/
207 2019-06-15 17:18:34 source /etc/profile
创建虚拟环境
[root@VM_0_2_centos home]# virtualenv --no-site-packages venv New python executable in /home/venv/bin/python2 Also creating executable in /home/venv/bin/python Please make sure you remove any previous custom paths from your /root/.pydistutils.cfg file. Installing setuptools, pip, wheel... done. [root@VM_0_2_centos home]# source venv/bin/activate (venv) [root@VM_0_2_centos home]# (venv) [root@VM_0_2_centos home]# (venv) [root@VM_0_2_centos home]# (venv) [root@VM_0_2_centos home]# (venv) [root@VM_0_2_centos home]# deactivate [root@VM_0_2_centos home]#
安装nginx