C:\>pip install Django==2.1.3
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting Django==2.1.3
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/d1/e5/2676be45ea49cfd09a663f289376b3888accd57ff06c953297bfdee1fb08/Django-2.1.3-py3-none-any.whl (7.3MB)
100% |████████████████████████████████| 7.3MB 2.3MB/s
Requirement already satisfied: pytz in c:\program files (x86)\python37-32\lib\site-packages (from Django==2.1.3) (2018.5)
Installing collected packages: Django
Found existing installation: Django 2.0.7
Uninstalling Django-2.0.7:
Successfully uninstalled Django-2.0.7
Successfully installed Django-2.1.3
You are using pip version 18.0, however version 18.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
C:\>python -m pip install --upgrade pip
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting pip
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/c2/d7/90f34cb0d83a6c5631cf71dfe64cc1054598c843a92b400e55675cc2ac37/pip-18.1-py2.py3-none-any.whl (1.3MB)
100% |████████████████████████████████| 1.3MB 1.8MB/s
Installing collected packages: pip
Found existing installation: pip 18.0
Uninstalling pip-18.0:
Successfully uninstalled pip-18.0
Successfully installed pip-18.1
测试django有没有安装成功:
C:\>python
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47) [MSC v.1914 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>> django.version
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'django' has no attribute 'version'
>>> django.VERSION
(2, 1, 3, 'final', 0)
>>>