[Answer]-Unable to import django, conflicting python paths?

1👍

You should import django, not Django, watch the case.

Demo:

$ pip install django
Requirement already satisfied (use --upgrade to upgrade): django in ...
Cleaning up...
$ python
Python 2.7.5 (default, Aug 25 2013, 00:04:04) 
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import Django
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named Django
>>> import django
>>>
👤alecxe

0👍

I couldn’t fix the $PATH conflict between my OSX default version (2.7.10) and my pip installed one (3.8). Instead, I manually specify the entire path when calling django-admin:

Go to your project folder in console and type (check your version first).

your_proyect_folder$ python3 /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/django/bin/django-admin.py startproject your_folder_name

Leave a comment