ModuleNotFoundError: No module named ‘widgets‘

"C:\Program Files\JetBrains\PyCharm 2017.1.3\bin\runnerw.exe" C:\Users\huanglianggu\AppData\Local\Programs\Python\Python38\python.exe "C:\Program Files\JetBrains\PyCharm 2017.1.3\helpers\pydev\pydevd.py" --multiproc --qt-support --client 127.0.0.1 --port 53027 --file C:/Users/huanglianggu/PycharmProjects/calb_xadmin_v1/manage.py runserver 8000
C:\Program Files\JetBrains\PyCharm 2017.1.3\helpers\pydev\_pydevd_bundle\pydevd_resolver.py:158: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if found.get(name) is not 1:
warning: Debugger speedups using cython not found. Run '"C:\Users\huanglianggu\AppData\Local\Programs\Python\Python38\python.exe" "C:\Program Files\JetBrains\PyCharm 2017.1.3\helpers\pydev\setup_cython.py" build_ext --inplace' to build.
pydev debugger: process 19968 is connecting

Connected to pydev debugger (build 171.4424.42)
C:\Program Files\JetBrains\PyCharm 2017.1.3\helpers\pydev\_pydevd_bundle\pydevd_resolver.py:158: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if found.get(name) is not 1:
warning: Debugger speedups using cython not found. Run '"C:\Users\huanglianggu\AppData\Local\Programs\Python\Python38\python.exe" "C:\Program Files\JetBrains\PyCharm 2017.1.3\helpers\pydev\setup_cython.py" build_ext --inplace' to build.
pydev debugger: process 22016 is connecting

Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
  File "C:\Users\huanglianggu\AppData\Local\Programs\Python\Python38\lib\threading.py", line 932, in _bootstrap_inner
    self.run()
  File "C:\Users\huanglianggu\AppData\Local\Programs\Python\Python38\lib\threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\huanglianggu\AppData\Local\Programs\Python\Python38\lib\site-packages\django\utils\autoreload.py", line 54, in wrapper
    fn(*args, **kwargs)
  File "C:\Users\huanglianggu\AppData\Local\Programs\Python\Python38\lib\site-packages\django\core\management\commands\runserver.py", line 109, in inner_run
    autoreload.raise_last_exception()
  File "C:\Users\huanglianggu\AppData\Local\Programs\Python\Python38\lib\site-packages\django\utils\autoreload.py", line 77, in raise_last_exception
    raise _exception[1]
  File "C:\Users\huanglianggu\AppData\Local\Programs\Python\Python38\lib\site-packages\django\core\management\__init__.py", line 337, in execute
    autoreload.check_errors(django.setup)()
  File "C:\Users\huanglianggu\AppData\Local\Programs\Python\Python38\lib\site-packages\django\utils\autoreload.py", line 54, in wrapper
    fn(*args, **kwargs)
  File "C:\Users\huanglianggu\AppData\Local\Programs\Python\Python38\lib\site-packages\django\__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "C:\Users\huanglianggu\AppData\Local\Programs\Python\Python38\lib\site-packages\django\apps\registry.py", line 114, in populate
    app_config.import_models()
  File "C:\Users\huanglianggu\AppData\Local\Programs\Python\Python38\lib\site-packages\django\apps\config.py", line 211, in import_models
    self.models_module = import_module(models_module_name)
  File "C:\Users\huanglianggu\AppData\Local\Programs\Python\Python38\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "C:\Users\huanglianggu\AppData\Local\Programs\Python\Python38\lib\site-packages\DjangoUeditor\models.py", line 4, in <module>
    from widgets import UEditorWidget,AdminUEditorWidget
ModuleNotFoundError: No module named 'widgets'

解决办法:

from widgets import UEditorWidget,AdminUEditorWidget
会显示:ModuleNotFoundError: No module named ‘widgets’
原因:直接采用“pip install DjangoUeditor”安装的DjangoUeditor,是基于Python 2.7的,对Python3的不兼容。导致不能import widgets.py文件。
解决办法:在github下载兼容python3的DjangoUeditor,将DjangoUeditor放入到自己运行的虚拟坏境中
 

下载地址:https://github.com/twz915/DjangoUeditor3

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值