vim InStall-Django.sh
#!/bin/bash rm -rf /usr/bin/python ln -s /usr/bin/python3 /usr/bin/python mkdir -p /root/script rm -rf /root/script/get-pip.py wget -O get-pip.py https://bootstrap.pypa.io/get-pip.py python get-pip.py ln -s /usr/local/bin/pip /usr/bin/pip pip --version echo yes | pip install Django==1.11.8 exit 0
# 直接执行脚本吧,问题不大。
bash -x InStall-Django.sh
# 确认已安装
root@ubuntu-virtual-machine:~/script# python
Python 3.5.2 (default, Nov 23 2017, 16:37:01)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>> django.VERSION
(1, 11, 8, 'final', 0)
>>> django.get_version()
'1.11.8'
>>>