ModuleNotFoundError:没有名为“taggit”的模块;

发布于 2025-01-16 16:57:52 字数 364 浏览 4 评论 0原文

我使用 pip install 来安装 django taggit,我确认 pip freeze 是否存在,我在已安装的应用程序中包含 taggit,当我想要进行迁移时,它给了我这个错误 ModuleNotFoundError: No module named 'taggit'< /code>,我使用 pip freeze 来确认已安装并已安装,我将其添加到installed_apps并且也在那里

我尝试卸载/安装尝试不同的版本但不起作用它总是给我相同的错误ModuleNotFoundError:没有名为“taggit”的模块,即使已安装在已安装的应用程序上,并且我使用 pip freeze 确认该模块位于目录中,有什么想法吗?

I used pip install to install django taggit, I am confirming that is there with pip freeze I am including taggit on installed apps and when I want to do the migrations it gives me this error ModuleNotFoundError: No module named 'taggit', I used pip freeze to confirm that is installed and is installed, I added it to installed_apps and is there as well

I tried to uninstall/ install try different versions and is not working it gives me always same error ModuleNotFoundError: No module named 'taggit', even though is installed on installed apps and I confirmed with pip freeze that is on the directory, any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

左耳近心 2025-01-23 16:57:53

这对我有用。我浏览到我的 virtualenv 的站点包,注意到“taggit”模块是以“django-taggit-3.1.0”之类的名称安装的。在其中找到真正的“taggit”包并剪切并粘贴该模块,它的内容位于我的 virtualenv 的站点包的根目录中。
我没有像 "env/lib/site-packages/django-taggit-3.1.0/taggit" 这样的路径,而是 <强>“env/lib/site-packages/taggit”

This worked for me. I browsed to the site-packages of my virtualenv, noticed that "taggit" module was installed under a name like "django-taggit-3.1.0". Found the real "taggit" package inside it and cut and pasted the module, and it contents in the root directory of the site-packages of my virtualenv.
Instead of having a path like that "env/lib/site-packages/django-taggit-3.1.0/taggit", I'm having that "env/lib/site-packages/taggit".

壹場煙雨 2025-01-23 16:57:53

就我而言,我在运行脚本时忘记激活安装了 django-taggit 的环境(即在一个控制台窗口中激活它,但在我所在的控制台窗口中没有这样做)运行 python manage.py runserver 脚本`)。

In my case, I have forgotten to activate the environment where django-taggit was installed when I was running a script (i.e. activated it in one console window, but didn't do it in the one I was running the python manage.py runserver script`).

一生独一 2025-01-23 16:57:53

您必须使用此命令安装它

pip 安装 django-taggit

然后添加到您的设置中。下面是设置中的样子。

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'taggit',
]

以下是有关 taggit https://www.youtube 的更多信息的视频链接。 com/watch?v=dZywiX-Glu4

You have to install it with this command

pip install django-taggit

Then add to your setting. bellow is what it should look like in settings.

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'taggit',
]

here is a link to a video with more info about taggit https://www.youtube.com/watch?v=dZywiX-Glu4

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文