Linux
pip3 install django
#默认pip 和python环境都已安装好,如果没有参见https://blog.csdn.net/weixin_38280090/article/details/81707017
Windows
#已经装好python3
1.打开cmd
where pip #查询pip路径 例C:\Users\Admin>F:\Users\Admin\AppData\Local\Programs\Python\Python36\Scripts\pip.exe
2.使用pip安装django
C:\Users\Admin>F:\Users\Admin\AppData\Local\Programs\Python\Python36\Scripts\pip.exe install django
C:\Users\Admin>where pip
F:\Users\Admin\AppData\Local\Programs\Python\Python36\Scripts\pip.exe
C:\Users\Admin>F:\Users\Admin\AppData\Local\Programs\Python\Python36\Scripts\pip.exe install django
Collecting django
Downloading https://files.pythonhosted.org/packages/51/1a/e0ac7886c7123a03814178d7517dc822af0fe51a72e1a6bff26153103322/Django-2.1-py3-none-any.whl (7.3MB)
100% |████████████████████████████████| 7.3MB 2.4MB/s
Collecting pytz (from django)
Downloading https://files.pythonhosted.org/packages/30/4e/27c34b62430286c6d59177a0842ed90dc789ce5d1ed740887653b898779a/pytz-2018.5-py2.py3-none-any.whl (510kB)
100% |████████████████████████████████| 512kB 3.0MB/s
Installing collected packages: pytz, django
The script django-admin.exe is installed in 'f:\users\admin\appdata\local\programs\python\python36\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed django-2.1 pytz-2018.5
You are using pip version 10.0.1, however version 18.0 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.