Forums

Error running WSGI application : ModuleNotFoundError: No module named 'taggit'

why? already installed

https://imgur.com/a/ktI7JS2

From your first screenshot, it looks like you've installed the packages into a virtualenv. In order to use that env in your website, you need to specify it on the "Web" page -- the place to do that is just under the "Code" section that you show in your second screenshot.

and how I specific it? which folder is the virtualenv? I'm in the virtual environment but the folder does not appear anywhere.

if you are in the virtualenv environment then doing a which python might give you a hint as to where the folder is approximately.

To specify your virtualenv for your webapp you should go to the webapp tab and scroll to the section about virtualenvs and then input the virtualenv path as indicated.

Hi I have the same issue. I already included my virtual env but the problem still persists, any other solution? TIA

These are the things you need to check 1. If you're using a virtualenv, are you running in the same virtualenv as you're installing into? 2. Does the thing you're trying to install get imported the way you're trying to import it?

If you get those correct, it will work.

Righto, I have ran in to the same issue. Was working, I've done something stupid, can't figure out what.

Any help would be appricated!

Venv - https://ibb.co/dMF7Td7

Pip freeze in that env - https://ibb.co/kMP8DSD

setting.py - https://ibb.co/wNKwcfd

enter image description here - https://ibb.co/ZxvmjjD

That's a surprising error, certainly, but are you sure you need to add it to INSTALLED_APPS? I don't see any reference to that in the docs, though I may well have missed something.

Yeah, it's on the getting started page 3rd line - https://django-taggit.readthedocs.io/en/latest/getting_started.html

I'll remove it from INSTALLED_APPS and see if it makes a difference. Could it be database connection related?

PS Giles, why are you working on the weekend? Thanks for taking the time to reply!

Ok, if I commented out the the tagget.manager and the field that reference to it and remove 'taggit' from the INSTALLED_APPS the ./manage migrate works. As soon as I remove the comments, I get the same "ModuleNotFoundError: No module named 'taggit'" error

model.py :::python

from django.db import models
#from taggit.managers import TaggableManager

class Product(models.Model):

    sku = models.CharField(
        max_length = 9,
        unique = True,
        )

    description = models.CharField(max_length=100)

        slug = models.SlugField(
            unique = True,
            max_length= 100,
        )

    #tags = TaggableManager()

    def __str__(self):
        return self.description

Ok, I fixed it by re-installing the virtual environment and re-installing taggit. It's all working! Thanks Giles

Glad to hear you got it working! That does sound weird, though -- maybe the first install went wrong in some non-obvious way and only installed part of it.

Re: the weekend thing -- someone on the team has to, and this is my turn :-)