如何解决django升级的错误问题

当你用命令行安装时出现错误:

Cannot uninstall 'Django'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

说明你以前已经安装过了,所以你要卸载你之前安装的djangdo路径,

下面给出命令符中的方法:

python

import sys;

sys.path = sys.path[1:];import

import django; print(django.__path__)

得到 django 安装目录 ['/Library/Python/2.7/site-packages/django']

我的路径是C:\Users\Administrator.WIN-6ELQJHTNAPD\AppData\Local\Programs\Python\Python36-32\Lib\site-packages

这里重点找的Lib\site-packages,找到后删除djando目录和和以djando开头.....egg结尾的文件,然后在重新安装就不会出错了

然后你可以查看你的django的版本

pip show django


猜你喜欢

转载自blog.csdn.net/qq_41682681/article/details/80981694