创建虚拟环境
~/project/hanqin/django> virtualenv monitor2
~/project/hanqin/django/monitor2> cd bin
~/project/hanqin/django/monitor2/bin> source activate

上传Django-1.11.11到以下文件夹
~/project/hanqin/django/monitor2/tmp
~/project/hanqin/django/monitor2/tmp> cd Django-1.11.11/
~/project/hanqin/django/monitor2/tmp/Django-1.11.11> python3 setup.py install

安装时候最后面因为没网报错,

Processing dependencies for Django==1.11.11
Searching for pytz
Reading https://pypi.python.org/simple/pytz/
Download error on https://pypi.python.org/simple/pytz/: unknown url type: https -- Some packages may not be found!
Couldn't find index page for 'pytz' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
Download error on https://pypi.python.org/simple/: unknown url type: https -- Some packages may not be found!
No local packages or working download links found for pytz
error: Could not find suitable distribution for Requirement.parse('pytz')

 

去官网下载对应版本的tz,tz是timezone时区的意思,我用的python3.6下的是标红版本

https://pypi.python.org/pypi/pytz/#downloads

 

 

~/project/hanqin/django/monitor2/tmp> tar -zxvf pytz-2018.3.tar.gz 

~/project/hanqin/django/monitor2/tmp> cd pytz-2018.3/

~/project/hanqin/django/monitor2/tmp/pytz-2018.3> python3 setup.py  install

 

 

 

~/project/hanqin/django/monitor2/tmp/pytz-2018.3> cd /home/insp_ap/project/hanqin/django/monitor2/lib/python3.6/site-packages/

~/project/hanqin/django/monitor2/lib/python3.6/site-packages> ls -lrt
total 511
drwxr-xr-x 2 insp_ap users 344 Apr 7 10:42 setuptools-28.8.0.dist-info
drwxr-xr-x 5 insp_ap users 1032 Apr 7 10:42 setuptools
drwxr-xr-x 5 insp_ap users 160 Apr 7 10:42 pkg_resources
-rw-r--r-- 1 insp_ap users 126 Apr 7 10:42 easy_install.py
drwxr-xr-x 2 insp_ap users 96 Apr 7 10:42 __pycache__
drwxr-xr-x 2 insp_ap users 312 Apr 7 10:42 wheel-0.29.0.dist-info
drwxr-xr-x 6 insp_ap users 592 Apr 7 10:42 wheel
drwxr-xr-x 2 insp_ap users 280 Apr 7 10:42 pip-9.0.1.dist-info
drwxr-xr-x 11 insp_ap users 648 Apr 7 10:42 pip
drwxr-xr-x 4 insp_ap users 96 Apr 7 10:50 Django-1.11.11-py3.6.egg
-rw-r--r-- 1 insp_ap users 510240 Apr 7 10:56 pytz-2018.3-py3.6.egg
-rw-r--r-- 1 insp_ap users 51 Apr 7 10:56 easy-install.pth
(monitor2) insp_ap@inspect01:~/project/hanqin/django/monitor2/lib/python3.6/site-packages>

~/project/hanqin/django/monitor2/lib/python3.6/site-packages> cat easy-install.pth
./Django-1.11.11-py3.6.egg
./pytz-2018.3-py3.6.egg