[Django]-Python not recognising Django Installation. (ImportError: No module named django)

4👍

It is likely that your pip installation is pointing to a different python than your python version installed at opt/local/bin/python. It is likely that your pip is talking to the system installed python and not the version you installed.

You can consider uninstalling python and re-installing in the correct path or creating a virtualenv that points to the version of python you desire. Then any subsequent installs will point to the correct version of python without affecting other python installs

4👍

try using pip as the superuser :

sudo pip install -U django

worked for me …

2👍

The previous answer was correct. The solution does not require reinstall python. Best practice to use virtalenv. On the mac, ‘pip’ will reference python2 by default, to use python3’s pip the command is ‘pip3’ or ‘pip3.4’. In the current virtualenv, use ‘pip list’ or ‘pip3 list’ to display all installed modules, if django is not install then ‘pip install django’.

Leave a comment