No module named django but it is installed

Probably, pip installs packages into dist-packages directory, which is not included into PYTHONPATH environment variable. You have a couple of solutions:

  1. Create and configure virtualenv for your project, before using pip. This is the most Pythonic way
  2. Try to install Django using built-in pip module:python -m pip install django This command should install packages into site-packages directory.
  3. You may also add dist-packages to your PYTHONPATH. This question should help you: How to globally modify the default PYTHONPATH (sys.path)?

Leave a Comment