Django:setup.py install - 访问被拒绝?
现在我想我知道我的问题的答案问题....这都是因为我使用 pypm 安装了 django...而且还有其他问题!
我按照他们所说的做了,第一个答案:重新开始,第二个答案:如果从 pypm 安装,pydev 不会检测到 django,
所以我决定重新开始,从 0....从 pypm 卸载 django 并删除所有其他相关文件夹到 django 并决定以旧方式安装 django,当我运行
setup.py install
而不是安装 django 安装程序时,会发生一个名为 django-admin.py 的文件在派佩!!! (我不知道它是从哪里创建的!!)
所以我删除了 pype - 只是为了看看会发生什么并运行相同的命令现在发生的是打开窗口显示,它要求我选择一个程序来打开 django ,如果我按取消,它会说“访问被拒绝
,我正在使用 Windows XP Pro 顺便
编辑,
所以这就是发生的情况,正如我之前所说,当使用 pypm 安装时 pydev 没有检测到 django,我设法按照 KillianDS 所说安装 django,
python setup.py install
但 pydev 仍然没有检测到它,尽管它配置正确
我上传图像只是为了证明这一点,正如我所说,python 是使用 activepython 安装的,请不要告诉我删除它并从 python.org 安装它,因为我完全相信 pydev 有问题
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
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
我猜想 Windows 已将所有
.py
文件与您的文本编辑器 pype 相关联。因此,当一个脚本尝试通过要求 Windows“打开”.py 文件来运行另一个脚本时,它只会在编辑器中弹出而不是执行。右键单击 Windows 资源管理器中的
.py
文件,选择 open-with,并告诉它始终使用 python 解释器 python.exe 打开.py
文件,而不是派佩。看看是否能解决问题。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.您可以尝试在 virtualenv 中安装 Django。 virtualenv 允许您决定要安装 Python 包的位置。您可以将其安装在您想要的目录中(如果您具有所需的权限)。 virtualenv 可以是一个干净的房间环境,不包括所有系统范围的模块,也可以使用这些模块以及仅在 virtualenv 中可用的模块。
将洁净室 virtualenv 放置在您绝对确定拥有所需权限的位置可以帮助您了解是否是文件系统权限问题或旧 .py 或 .pyc 文件位于您忘记的位置的问题。
如果将 virtualenv 中的相应目录添加到 PYTHONPATH,则可以在不同环境中使用 virtualenv 中已安装的 Python 模块,因此您无需担心如果使用 virtualenv,将无法使用 Eclipse 或任何其他环境不再是 IDE/编辑器了。您只需要适当配置它即可。
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 是 Django 附带的一个文件,用于启动 django 项目并执行其他管理工作。阅读以下链接以获取更多信息:
https://docs.djangoproject.com/en/de
检查它试图将 django 模块安装到哪些目录。它应该位于 C:/PythonXXXX/lib/... 下的 site-packages 文件夹中。
您可能需要管理员权限才能访问计算机上的该文件夹,特别是如果它是工作计算机。
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.
您最好的选择是摆脱当前的安装并从头开始。什么是 pype?
https://docs.djangoproject.com/en/dev/topics/install/ <--- 事实证明,在 Windows 7 和 Ubuntu 上安装时这对我非常有用
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
您是否尝试过这个简单的方法(实际上是安装过程中最简单的方法)。
cd "My Documents\progging\python\Django-1.3"
python setup.py install
(因此明确将 python 作为程序,而不是 setup.py)Did you try this simple method (actually the easiest of them all when it comes to installing).
cd "My Documents\progging\python\Django-1.3"
python setup.py install
(so explicitly give python as a program, not setup.py)我会尝试在 Windows 命令行上从 Django 源代码目录运行以下命令:
我一直这样做,因为我的系统上安装了多个版本的 Python。当然,将 Python26 替换为你的 Python 安装目录。
I would try runnig the following command from the Django source code directory on the windows command line:
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.