安装xadmin 出现版本兼容问题

安装xadmin 出现版本兼容问题

pip install git+git://github.com/sshwsfc/xadmin.git 安装xadmin 出现版本兼容问题

Successfully built xadmin httplib2 future markuppy odfpy et-xmlfile

ERROR: django-import-export 2.3.0 has requirement Django>=2.0, but you'll have django 1.11.29 which is in

compatible.

Installing collected packages: django-crispy-forms, django-reversion, django-formtools, markuppy, defused

xml, odfpy, xlrd, xlwt, jdcal, et-xmlfile, openpyxl, pyyaml, tablib, diff-match-patch, django-import-expo

rt, httplib2, future, six, xadmin

Successfully installed defusedxml-0.6.0 diff-match-patch-20200713 django-crispy-forms-1.9.2 django-formto

ols-2.2 django-import-export-2.3.0 django-reversion-3.0.8 et-xmlfile-1.0.1 future-0.18.2 httplib2-0.9.2 j

dcal-1.4.1 markuppy-1.14 odfpy-1.4.1 openpyxl-3.0.5 pyyaml-5.3.1 six-1.15.0 tablib-2.0.0 xadmin-0.6.1 xlr

d-1.2.0 xlwt-1.3.0

WARNING: You are using pip version 20.1.1; however, version 20.2.3 is available.

You should consider upgrading via the 'E:\envs\py3.72-GY0UNFYD\Scripts\python.exe -m pip install --upgrade pip' command.


(py3.72) E:\python-project\django_malls>python manage.py migrate

Traceback (most recent call last):

  File "manage.py", line 22, in <module>

    execute_from_command_line(sys.argv)

  File "E:\envs\py3.72-GY0UNFYD\lib\site-packages\django\core\management\__init__.py", line 364, in execu

te_from_command_line

    utility.execute()

  File "E:\envs\py3.72-GY0UNFYD\lib\site-packages\django\core\management\__init__.py", line 338, in execu

te

    django.setup()

  File "E:\envs\py3.72-GY0UNFYD\lib\site-packages\django\__init__.py", line 27, in setup

    apps.populate(settings.INSTALLED_APPS)

  File "E:\envs\py3.72-GY0UNFYD\lib\site-packages\django\apps\registry.py", line 116, in populate

    app_config.ready()

  File "E:\envs\py3.72-GY0UNFYD\lib\site-packages\django\contrib\admin\apps.py", line 23, in ready

    self.module.autodiscover()

  File "E:\envs\py3.72-GY0UNFYD\lib\site-packages\django\contrib\admin\__init__.py", line 26, in autodisc

over

    autodiscover_modules('admin', register_to=site)

  File "E:\envs\py3.72-GY0UNFYD\lib\site-packages\django\utils\module_loading.py", line 50, in autodiscov

er_modules

    import_module('%s.%s' % (app_config.name, module_to_search))

  File "c:\python372\lib\importlib\__init__.py", line 127, in import_module

    return _bootstrap._gcd_import(name[level:], package, level)

  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import

  File "<frozen importlib._bootstrap>", line 983, in _find_and_load

  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked

  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked

  File "<frozen importlib._bootstrap_external>", line 728, in exec_module

  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed

  File "E:\envs\py3.72-GY0UNFYD\lib\site-packages\reversion\admin.py", line 10, in <module>

    from django.urls import reverse, re_path

ImportError: cannot import name 're_path' from 'django.urls' (E:\envs\py3.72-GY0UNFYD\lib\site-packages\d

jango\urls\__init__.py)


(py3.72) E:\python-project\django_malls>python manage.py migrate

Traceback (most recent call last):

  File "manage.py", line 22, in <module>

    execute_from_command_line(sys.argv)

  File "E:\envs\py3.72-GY0UNFYD\lib\site-packages\django\core\management\__init__.py", line 364, in execu

te_from_command_line

    utility.execute()

  File "E:\envs\py3.72-GY0UNFYD\lib\site-packages\django\core\management\__init__.py", line 338, in execu

te

    django.setup()

  File "E:\envs\py3.72-GY0UNFYD\lib\site-packages\django\__init__.py", line 27, in setup

    apps.populate(settings.INSTALLED_APPS)

  File "E:\envs\py3.72-GY0UNFYD\lib\site-packages\django\apps\registry.py", line 116, in populate

    app_config.ready()

  File "E:\envs\py3.72-GY0UNFYD\lib\site-packages\django\contrib\admin\apps.py", line 23, in ready

    self.module.autodiscover()

  File "E:\envs\py3.72-GY0UNFYD\lib\site-packages\django\contrib\admin\__init__.py", line 26, in autodisc

over

    autodiscover_modules('admin', register_to=site)

  File "E:\envs\py3.72-GY0UNFYD\lib\site-packages\django\utils\module_loading.py", line 50, in autodiscov

er_modules

    import_module('%s.%s' % (app_config.name, module_to_search))

  File "c:\python372\lib\importlib\__init__.py", line 127, in import_module

    return _bootstrap._gcd_import(name[level:], package, level)

  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import

  File "<frozen importlib._bootstrap>", line 983, in _find_and_load

  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked

  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked

  File "<frozen importlib._bootstrap_external>", line 728, in exec_module

  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed

  File "E:\envs\py3.72-GY0UNFYD\lib\site-packages\reversion\admin.py", line 10, in <module>

    from django.urls import reverse, re_path

ImportError: cannot import name 're_path' from 'django.urls' (E:\envs\py3.72-GY0UNFYD\lib\site-packages\d

jango\urls\__init__.py)

 现在我该怎么办, 把django升级到2.0嘛? 这样的话对后面的视频操作会有影响的吧。

正在回答 回答被采纳积分+1

登陆购买课程后可参与讨论,去登陆

2回答
好帮手慕小猿 2020-09-27 18:17:52

同学你好,xadmin源码安装包进行了更新,不适合现在的django 版本,同学可以使用资料区上传的xadmin安装包进行安装,老师已上传到资料区,同学可根据教程进行配置

http://img1.sycdn.imooc.com//climg/5f70667609cbce1904300146.jpg

祝学习愉快~

好帮手慕小猿 2020-09-27 10:49:11

同学你好,可以登陆如下网址,试着安装低版本的django,这样无需修改,可以按照视频进行学习
1、登陆网址 

2、点击左侧master

3、选择低版本django1.8的xadmin



http://img1.sycdn.imooc.com//climg/5f6ffcf60911db7212430816.jpg
如果我的回答解决了你的疑惑,请采纳,祝学习愉快~

  • 提问者 丛从绿草 #1
    需要把之前安装的xadmin卸载嘛 ? 卸载是怎么写来着啊 ? 我忘了... 我现在是直接接着安装1.8版本的, 慢好多,一直不动, 不知道是不是没有卸载新版本的问题。
    2020-09-27 11:26:37
  • 好帮手慕小猿 回复 提问者 丛从绿草 #2
    同学你好,需要卸载之前的xadmin,使用命令pip uninstall xadmin,把xadmin的所有数据都删除,然后重新安装xadmin,同学可按视频‘xadmin 介绍、安装及配置’中老师讲解的4:14秒处学习找匹配的版本进行安装 祝学习愉快~
    2020-09-27 11:46:26
  • 提问者 丛从绿草 #3
    好像不行啊 Requirement already satisfied: et-xmlfile in e:\envs\py3.72-gy0unfyd\lib\site-packages (from openpyxl>=2. 6.0; extra == "xlsx"->tablib[html,ods,xls,xlsx,yaml]>=0.14.0->django-import-export>=0.5.1->xadmin==0.6.1) (1.0.1) Requirement already satisfied: jdcal in e:\envs\py3.72-gy0unfyd\lib\site-packages (from openpyxl>=2.6.0; extra == "xlsx"->tablib[html,ods,xls,xlsx,yaml]>=0.14.0->django-import-export>=0.5.1->xadmin==0.6.1) (1.4 .1) Building wheels for collected packages: xadmin Building wheel for xadmin (setup.py) ... done Created wheel for xadmin: filename=xadmin-0.6.1-py3-none-any.whl size=1238359 sha256=ac1864d8f188b3fbc7 82b54589485fce72e9f154c25dc741f30406ac99679a8b Stored in directory: C:\Users\ASUS\AppData\Local\Temp\pip-ephem-wheel-cache-oy1_d1i3\wheels\21\7a\dd\1e 8f5a496351b1555ac08baa987ff0092f4f4a18da85af52d9 Successfully built xadmin WARNING: You are using pip version 20.1.1; however, version 20.2.3 is available. You should consider upgrading via the 'E:\envs\py3.72-GY0UNFYD\Scripts\python.exe -m pip install --upgrad e pip' command.
    2020-09-27 11:50:28
问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
3.从网页搭建入门Python Web
  • 参与学习           人
  • 提交作业       218    份
  • 解答问题       3562    个

本阶段带你用Python开发一个网站,学习主流框架Django+Flask是Python Web开发的第一步,在基础知识上实现积分商城的项目开发,体验真实的项目开发流程,提高解决编程问题和效率的能力。

了解课程
请稍等 ...
意见反馈 帮助中心 APP下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师