tipu
tipu

Reputation: 9604

pydev not recognizing python installation with django

I have python installed with django. I know the installation is there because I installed it following the directions and in the command line I can do "import python" and there is no crash.

When I try creating a django project in pydev, I get an error: "Django not found."

What could the problem be?

Upvotes: 15

Views: 11690

Answers (10)

Morez
Morez

Reputation: 2196

Same problem I have faced today. I took help from these answer. but in my case it didnt work.

There is small modification in @antonkeren answer.

1) Go to Preferences. Windows > preferences.

2) Search for Pydev

3) Select Python Interpreter

4) Pressed Quick Auto-config

5) now download www.djangoproject.org/downloads django tar and extract on any location.

6) now click on Folder in "Libraries tab" of "System PYTHONPATH" and select your extracted django project folder location.

7) Click on apply and ok.

Creating a Django project afterwards should be ok.

Cheers...!!

Upvotes: 0

shawnwall
shawnwall

Reputation: 4607

I was having this same exact problem today, and I just wanted to add some notes to help people out. You can follow the instructions of antonkeren above, but there's one thing to note that was not mentioned. After adding the django directory to the path you must QUIT ECLIPSE OR APTANA STUDIO. After you restart it and try to create a django project it will work.

Upvotes: 2

sibby
sibby

Reputation: 11

If everything is done as said above, and still showing "Django not found" while your are trying to create django project, let try to double click 'django-admin' python file that in scripts folder of python. And try to create django project

Upvotes: 1

hassanadnan
hassanadnan

Reputation: 435

Use auto config in the preferences option and then click apply and then ok.

Upvotes: 1

user1295343
user1295343

Reputation:

I had the same problem and had solved it by adding the python home directory to the PATH variable and reconfigure the python interpreter on pydev.

Upvotes: 1

antonkeren
antonkeren

Reputation: 211

I had the same problem and this is what I did just after installing eclipse:

  • Preferences > Interpreter Python
  • Pressed Auto-config
  • Selected /Library/Python/x.x/site-packages, which was not selected (some django folders were in there, persumably the installation)
  • Clicked apply / OK

Creating a Django project afterwards should be ok.

Good Luck!

Upvotes: 21

KeepItCool
KeepItCool

Reputation: 61

Jaffa,

You might have configured your python interpreter in Eclipse prior to installing Django in python.

So what you have to do now is in Eclipse remove the Python interpreter and add it again (now that it has Django installed) and all should work ok.

Upvotes: 6

Jaffa  McNeill
Jaffa McNeill

Reputation: 1

I think I've got the same problem, Eclipse 3.5.2 on Fedora. In my PyDev Python interpreter settings I've got the site-packages/django folder (site-packages/django/bin too, just in case), but when I try to create a django project I get an error dialogue saying "It seems that the selected interpreter does not have Django available". Looks like I'm going to have to use Eric4, which is a pity because I can't get that working at all on my Windows rig! Unless I manage to understand the cryptic advice above, "Django must not be among the system libraries for this to function..."

Upvotes: 0

cpt_ahag
cpt_ahag

Reputation: 254

I stumbled upon this only yesterday myself: Django must not be among the system libraries for this to function...

Upvotes: 1

mouad
mouad

Reputation: 70059

go in the menu to window -> preference -> pydev -> Interpreter - Python ; and add the python interpreter there, if you installed the django in a virtual environment you should add the python interpreter of the virtual env ; after adding the interpreter by clicking on new you should now click on Apply , you should see now all the system libs from PYTHONPATH added there between them Django .

hope this will help

Upvotes: 12

Related Questions