系统定制开发pip源更换为清华源

使用pip系统定制开发默认的镜像在国外,网络连接较差,下载速度比较慢

  1. D:\pythonProject3\Django>pip install Django==2.1.3
  2. Collecting Django==2.1.3
  3. Downloading Django-2.1.3-py3-none-any.whl (7.3 MB)
  4. |█████████████ | 3.0 MB 15 kB/s eta 0:04:46
  5. ERROR: Operation cancelled by user

此时,我们可以把源改为清华源,具体操作如下:

  1. D:\pythonProject3\Django>pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
  2. Writing to C:\Users\wtcai\AppData\Roaming\pip\pip.ini

如果仅是临时更换可以使用以下命令

pip install package -i https://pypi.tuna.tsinghua.edu.cn/simple

此时,我们再安装框架就会比较快了

  1. D:\pythonProject3\Django>pip install django==2.1.3
  2. Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
  3. Collecting django==2.1.3
  4. Downloading https://pypi.tuna.tsinghua.edu.cn/packages/d1/e5/2676be45ea49cfd09a663f289376b3888accd57ff06c
  5. 953297bfdee1fb08/Django-2.1.3-py3-none-any.whl (7.3 MB)
  6. |████████████████████████████████| 7.3 MB 6.4 MB/s
  7. Collecting pytz
  8. Downloading https://pypi.tuna.tsinghua.edu.cn/packages/d3/e3/d9f046b5d1c94a3aeab15f1f867aa414f8ee9d196fae
  9. 6865f1d6a0ee1a0b/pytz-2021.3-py2.py3-none-any.whl (503 kB)
  10. |████████████████████████████████| 503 kB ...
  11. Installing collected packages: pytz, django
  12. Successfully installed django-2.1.3 pytz-2021.3
  13. WARNING: You are using pip version 21.3.1; however, version 22.0.4 is available.
  14. You should consider upgrading via the 'c:\users\wtcai\appdata\local\programs\python\python37\python.exe -m
  15. pip install --upgrade pip' command.

查看Django是否正确安装

  1. D:\pythonProject3\Django>django-admin --version
  2. 2.1.3

 或者输入以下命令

  1. D:\pythonProject3\Django>django-admin --help
  2. Type 'django-admin help <subcommand>' for help on a specific subcommand.
  3. Available subcommands:
  4. [django]
  5. check
  6. compilemessages
  7. createcachetable
  8. dbshell
  9. diffsettings
  10. dumpdata
  11. flush
  12. inspectdb
  13. loaddata
  14. makemessages
  15. makemigrations
  16. migrate
  17. runserver
  18. sendtestemail
  19. shell
  20. showmigrations
  21. sqlflush
  22. sqlmigrate
  23. sqlsequencereset
  24. squashmigrations
  25. startapp
  26. startproject
  27. test
  28. testserver
  29. Note that only Django core commands are listed as settings are not properly configured (error: Requested se
  30. tting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJAN
  31. GO_SETTINGS_MODULE or call settings.configure() before accessing settings.).

参考连接

网站建设定制开发 软件系统开发定制 定制软件开发 软件开发定制 定制app开发 app开发定制 app开发定制公司 电商商城定制开发 定制小程序开发 定制开发小程序 客户管理系统开发定制 定制网站 定制开发 crm开发定制 开发公司 小程序开发定制 定制软件 收款定制开发 企业网站定制开发 定制化开发 android系统定制开发 定制小程序开发费用 定制设计 专注app软件定制开发 软件开发定制定制 知名网站建设定制 软件定制开发供应商 应用系统定制开发 软件系统定制开发 企业管理系统定制开发 系统定制开发