ImportError No module named django


#1

Hello

I am following Hello Web App and ran into an issue when trying to run my Django project. After setting up my virtual environment and installing dependencies, I get the following error when running python manage.py runserver:

ImportError: No module named django

I activated my virtual environment using source venv/bin/activate (on macOS/Linux) or venv\Scripts\activate (on Windows). Then; I ran pip install -r requirements.txt, but the error persists. I checked pip freeze, and it doesn’t list Django, even though there were no errors during installation. I also tried installing Django manually with pip install django & it appeared to install successfully; yet the issue remains.

I suspect this could be a problem with my virtual environment not being correctly linked to my project / an issue with pip not properly installing dependencies. Has anyone encountered this before? Checked https://docs.python-guide.org/dev/virtualenvs/Golang Training guide related to this and found it quite informative.

Are there specific checks I can run to confirm my environment is set up correctly? Any help would be appreciated!

Thank you !!