ModuleNotFoundError: No module named 'collection'



So I am stuck on the very initial stage of setting up the project… :(

I have reviewed the code you posted on GitHub, but it didn’t help me much.

When I am trying to migrate, console prints:

Traceback (most recent call last):
  File "", line 15, in <module>
  File "/home/aleksanderj/webprojects/myhellowebapp/venv/lib/python3.6/site-packages/django/core/management/", line 381, in execute_from_command_line
  File "/home/aleksanderj/webprojects/myhellowebapp/venv/lib/python3.6/site-packages/django/core/management/", line 357, in execute
  File "/home/aleksanderj/webprojects/myhellowebapp/venv/lib/python3.6/site-packages/django/", line 24, in setup
  File "/home/aleksanderj/webprojects/myhellowebapp/venv/lib/python3.6/site-packages/django/apps/", line 89, in populate
    app_config = AppConfig.create(entry)
  File "/home/aleksanderj/webprojects/myhellowebapp/venv/lib/python3.6/site-packages/django/apps/", line 90, in create
    module = import_module(entry)
  File "/usr/lib/python3.6/importlib/", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'collection'

This sucks so much!


Did you run the startapp command to create the app “collection”?

Does your directory look like this? (where the “collection” folder/directory is in the same place as

Basically Django doesn’t think you have an app named “collection” so I’m trying to figure out where it could be on your end. :)


Okay so I have deleted all the files to configure everything again, and I perhaps should mention that your way of creating a venv does not work, this one does:
~/projects/myhellowebapp$ python3 -m venv venv

I hope that’s okay.


The ‘projects’ folder looks like this:

Okay so I have literally no clue what’s wrong… There is no in the projects folder, but there shouldn’t be, right? Not before I run the migrate command


Double-checked - yes I started the app ‘collection’


so I tried doing the same on my other computer, and got a different error

~/projects/myhellowebapp$ python migrate
Traceback (most recent call last):
  File "", line 11, in <module>
    "Couldn't import Django. Are you sure it's installed and "
ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?
(venv) [email protected]:~/projects/myhellowebapp$ 

I am so so lost…


So looks like your collection folder is in the wrong place and you’re not in your virtualenvironment bubble. :)

So, first, delete the collection folder that’s in your projects folder. Then, go “into” your myhellowebapp folder (inspect the contents, make sure that there is a there).

Start your virtual environment ( — see the command to activate the environment). Think of your virtual environment like a bubble where things are. If your virtual environment isn’t activated, you’re not in the bubble, and you can’t access things “in” the bubble (like Django), which is why it says it can’t access Django in your other error message.

Once your environment is activated (and you get a (venv) or something similar in your command line), then create your collection app.

Looks like before you created the app in your “projects” folder, not in your “myhellowebapp” folder. This’ll put it in the right place.

Once the app is created and in the right place, then you can run migrate.

If you know you’ve activated your environment but your computer complains it doesn’t has Django, try installing Django again ( You might have installed it “outside” the bubble, but once you’re within the bubble, you might have to install it again.

Let me know if you receive any other errors. :)


Okay so, this was a silly mistake.

Everything works now. Thanks a lot!