简体   繁体   English

我在安装SWITIFY package 时出错,有人知道这是什么意思吗?

[英]I get an error when I install the SWITIFY package, does anyone know what it means?

when I install the package sweetify, I get the following error当我安装 package sweetify 时,出现以下错误

Does anyone know what the reason is?有谁知道原因是什么? I went through all the steps that were in the main dock我完成了主码头中的所有步骤

Traceback (most recent call last):
  File "C:\Program Files\Python38\lib\threading.py", line 932, in _bootstrap_inner
    self.run()
  File "C:\Program Files\Python38\lib\threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\nahid\PycharmProjects\fitshow\venv\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
    fn(*args, **kwargs)
  File "C:\Users\nahid\PycharmProjects\fitshow\venv\lib\site-packages\django\core\management\commands\runserver.py", line 125, in inner_run
    autoreload.raise_last_exception()
  File "C:\Users\nahid\PycharmProjects\fitshow\venv\lib\site-packages\django\utils\autoreload.py", line 87, in raise_last_exception
    raise _exception[1]
  File "C:\Users\nahid\PycharmProjects\fitshow\venv\lib\site-packages\django\core\management\__init__.py", line 398, in execute
    autoreload.check_errors(django.setup)()
  File "C:\Users\nahid\PycharmProjects\fitshow\venv\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
    fn(*args, **kwargs)
  File "C:\Users\nahid\PycharmProjects\fitshow\venv\lib\site-packages\django\__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "C:\Users\nahid\PycharmProjects\fitshow\venv\lib\site-packages\django\apps\registry.py", line 91, in populate
    app_config = AppConfig.create(entry)
  File "C:\Users\nahid\PycharmProjects\fitshow\venv\lib\site-packages\django\apps\config.py", line 228, in create
    import_module(entry)
  File "C:\Program Files\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 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "C:\Users\nahid\PycharmProjects\fitshow\venv\lib\site-packages\sweetify\__init__.py", line 1, in <module>
    from .sweetify import *
  File "C:\Users\nahid\PycharmProjects\fitshow\venv\lib\site-packages\sweetify\sweetify.py", line 5, in <module>
    from .encoder import LazyEncoder
  File "C:\Users\nahid\PycharmProjects\fitshow\venv\lib\site-packages\sweetify\encoder.py", line 2, in <module>
    from django.utils.encoding import force_text
ImportError: cannot import name 'force_text' from 'django.utils.encoding' (C:\Users\nahid\PycharmProjects\fitshow\venv\lib\site-packages\django\utils\encoding.py)

Looks like sweetify is not compatible with Django 4.0.看起来sweetify与 Django 4.0 不兼容。 See the changelog: https://docs.djangoproject.com/en/4.0/releases/4.0/#features-removed-in-4-0查看变更日志: https://docs.djangoproject.com/en/4.0/releases/4.0/#features-removed-in-4-0

django.utils.encoding.force_text() and smart_text() are removed. django.utils.encoding.force_text() 和 smart_text() 被移除。

Try with older version of django, I recommend 3.2.13:)尝试使用旧版本 django,我推荐 3.2.13:)

this error is coming from django v4.此错误来自 django v4。 according to django documentation django.utils.encoding.force_text() and smart_text() are removed.根据django 文档django.utils.encoding.force_text() and smart_text()被删除。

possible solution :可能的解决方案

1 - using Django version 4> add in settings.py : 1 - 使用 Django 版本 4> 在settings.py中添加:

import django
from django.utils.encoding import force_str
django.utils.encoding.force_text = force_str
  1. Downgrade your django version to django<=3将您的 django 版本降级为 django<=3

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我得到这个错误,我真的不知道它是什么意思 - I get this error and I really don't know what it means discord.py - 当我尝试更改用户名时出现这样的错误,有人知道如何解决吗? - discord.py - when i try to change username i get such an error does anyone know how to fix it? 有谁知道为什么在使用 Python (Locust) 打开 JSON 文件时在 Jenkins 中出现文件未找到错误? - Does anyone know why I get a file not found error in Jenkins when opening a JSON file with Python (Locust)? 我可以知道递归=真是什么意思吗? - May i know what does recursive=true means? 安装软件包时,此pip错误是什么意思? - What does this pip error means when installing a package? 在我的代码中出现 EOF 错误,我不知道这意味着什么 - Getting an EOF Error in my code and i dont know what that means 我不知道 EOF 错误是什么意思,我想知道各种东西支持什么版本的 Python - I do not know what an EOF error means and I want to know what version of Python various things support 有谁知道为什么我在运行此代码时得到一个无响应的pygame窗口 - Does anyone know why I get an unresponsive pygame window when running this code 有谁知道为什么我在尝试将列表转换为字典时会收到此错误? - Does anyone know why I am receiving this error when trying to convert a list to a dictionary? 有谁知道如何在 Windows 上安装 Python P5 Package? - Does anyone know how to install the Python P5 Package on Windows?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM