Django:setup.py install - 访问被拒绝?

发布于 2024-12-01 20:23:45 字数 1214 浏览 2 评论 0原文

我最近问了这个问题这个

现在我想我知道我的问题的答案问题....这都是因为我使用 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

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

生来就爱笑 2024-12-08 20:23:46

我猜想 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.

绿光 2024-12-08 20:23:46

您可以尝试在 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.

意中人 2024-12-08 20:23:46

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.

季末如歌 2024-12-08 20:23:46

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

纵性 2024-12-08 20:23:45

您是否尝试过这个简单的方法(实际上是安装过程中最简单的方法)。

  1. 打开 DOS shell(开始->运行...>cmd)
  2. cd 到您将 django 解压缩到的目录(例如 cd "My Documents\progging\python\Django-1.3"
  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).

  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)
甜柠檬 2024-12-08 20:23:45

我会尝试在 Windows 命令行上从 Django 源代码目录运行以下命令:

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

我一直这样做,因为我的系统上安装了多个版本的 Python。当然,将 Python26 替换为你的 Python 安装目录。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文