开发者

Django: setup.py install - access denied?

开发者 https://www.devze.com 2023-03-31 07:32 出处:网络
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 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 her开发者_高级运维e'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

Django: setup.py install - access denied?

Django: setup.py install - access denied?

Django: setup.py install - access denied?

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


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)


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.


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.


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.


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消