2

I have recently asked this question and this one

Now i think I know the answer to my questions....it's all because i installed django using pypm... and something else is wrong!

I did as they said, the first answer: start over, the 2nd answer: pydev do not detect detect django if installed from pypm

so i decided to start over, from 0....uninstalled django from pypm and deleted every other folder related to django and decided to install django the old fashion way, when I run

setup.py install 

instead of installing the django setup, what happen is there's a file called django-admin.py opens in pype!!! (i don't know from where it's created!!)

so I deleted pype - just to see what would happen and run the same command what happen now is the open with window shows up and it asks me to choose a program to open django, if i press cancel, it says `access denied

i'm using windows xp pro by the way

EDIT

so here's what happens, as I said earlier, pydev is not detecting django when installed with pypm, I managed to install django as KillianDS said

python setup.py install

but still pydev do not detect it, although, it is configured correctly

enter image description here

enter image description here

enter image description here

I uploaded the images just to prove it and as i said python is installed using activepython, please don't tell me to remove it and install it from python.org because I am totally convinced, there's something wrong with pydev

Community
  • 1
  • 1
Lynob
  • 5,059
  • 15
  • 64
  • 114

6 Answers6

2

I would try runnig the following command from the Django source code directory on the windows command line:

C:\Python26\python.exe setup.py install

I do this all the time since I have several versions of Python installed on my system. Of course, replace Python26 with your Python installation dir.

Carl F.
  • 6,718
  • 3
  • 28
  • 41
2

Did you try this simple method (actually the easiest of them all when it comes to installing).

  1. Open a DOS shell (start->Run...>cmd)
  2. cd to the directory you extracted django to (e.g. cd "My Documents\progging\python\Django-1.3"
  3. execute python setup.py install (so explicitly give python as a program, not setup.py)
KillianDS
  • 16,936
  • 4
  • 61
  • 70
  • sir your solution worked but the problem is still there, pydev won't detect it!! – Lynob Sep 01 '11 at 10:37
  • Okay, less experience with that one on windows. Most likely there is no django in your `PYTHONPATH` environment variable. As you can see on the second screen it only has a `c:\django` in there (probably old install), likely you also need something like `C:\python27\lib\site-packages\django`. How to set this can be found [here](http://docs.python.org/using/windows.html), section `3.3.1`. – KillianDS Sep 01 '11 at 11:24
  • thank you sir, i will award you the bounty in 5h coz stackoverflow is not letting me doing it now, I knew that if i change the path to the site-packages\django it will work, but i was so confused and so pissed off, because i asked it everywhere and i kept getting stupid answers – Lynob Sep 01 '11 at 14:20
  • i even joined the official django group,it's a google asked the question, the members sent me spams so i said: it's supposed to be the official django group you are sending spams, they replied saying: you could unsubscribe!! and the maintainer of pydev told me to uninstall django to fix the problem!! I didn't need to! See your answer was the best because it was the simplest!! – Lynob Sep 01 '11 at 14:24
  • Just to note, after installing django, you have to reconfigure the interpreter in PyDev (so, if django is in /lib/foo/django, /lib/foo must be added to the interpreter pythonpath -- see: http://pydev.org/manual_101_interpreter.html for details). – Fabio Zadrozny Sep 01 '11 at 17:21
1

I would guess that windows has associated all .py files with your text editor pype. So when a script tries to run another script by asking windows to "open" the .py file, it just pops up in your editor instead of executing.

Right click on a .py file in windows explorer, choose open-with, and tell it to always open .py files with your python interpreter, python.exe, instead of pype. See if that fixes it.

Leopd
  • 41,333
  • 31
  • 129
  • 167
  • i did that and now when i run setup.py install,the file setup.py opens up with the interpreter lol instead of installing django :D I know that there's a problem with my pc, not just a silly mistake, i just don't know what it is! – Lynob Aug 31 '11 at 21:43
  • Muck with your windows settings and your python install (maybe reinstall python) until when you double-click a .py file in file explorer and the python script runs (try hello world) then I bet you'll be good. – Leopd Aug 31 '11 at 22:00
  • man i not a newbie, i can run any python script, you know just forget it, I'll use turbo gears instead or better yet learn ruby on rails and just forgot about django - unless someone can give an answer that is worth 50 pts - python is working PERFECTLY, django is not, that's all i can say, I'm even ready to give you team viewer access to my pc just to prove it's not a silly issue! – Lynob Aug 31 '11 at 22:13
  • @Eli: I know it must be frustrating to run into such a basic problem. But that doesn't mean that you have to be so aggressive towards people who want to help, he is only trying and you'd be surprised how many times even the biggest experts make stupid "newbies" mistakes. – KillianDS Sep 01 '11 at 10:08
  • So sorry sir for everything i said – Lynob Sep 01 '11 at 10:36
1

You can try installing Django in a virtualenv. A virtualenv lets you decide where you want to install Python packages. You can install it in the directory you want (if you have the required permissions). A virtualenv can either be a clean room environment, excluding all system-wide modules, or use those modules as well as modules only available within the virtualenv.

Placing a clean room virtualenv in a location where you are absolutely sure that you will have the required permissions can help you understand whether it's an issue with file system permissions or something with old .py or .pyc files located somewhere you forgot about.

You can use the installed Python modules in a virtualenv in different environments if you add the appropriate directories within the virtualenv to PYTHONPATH, so you don't need to worry that if you use virtualenv, you will not be able to use Eclipse or any other IDE/editor anymore. You just need to configure it appropriately.

pvoosten
  • 3,247
  • 27
  • 43
  • In the python shell, type `>>> django.__file__` to see where Django is located, just to make absolutely sure that you added the correct directory in PyDev. – pvoosten Sep 01 '11 at 13:20
0

Django-admin.py is a file that comes with Django and is used to start django projects and do other administrative stuff. Read the following link for more information about it:

https://docs.djangoproject.com/en/de

Check to see which directories it is trying to install the django module into. It should wind up in the site-packages folder someplace under C:/PythonXXXX/lib/....

You may need admin permissions to access that folder on your machine, especially if it is a work machine.

josephmisiti
  • 9,862
  • 11
  • 56
  • 72
  • I know that the django-admin.py comes whith django to start the project but i said that i deleted django therefore this file should not be created...i'm the admin on my pc, it's my pc...and i know where django should be installed...setup.py install should take care of everything – Lynob Aug 29 '11 at 17:14
0

Your best bet would be to get rid of your current install and start from scratch. What's pype?

https://docs.djangoproject.com/en/dev/topics/install/ <--- this has proven very useful for me when installing on Windows 7 and Ubuntu

gp443
  • 231
  • 2
  • 11