初学者安装/运行 Django...Errno 10013?

发布于 2024-12-18 15:09:24 字数 354 浏览 0 评论 0原文

所以我对 Python 是一个相对新手,今天刚刚尝试安装和运行 Django。我正在按照官方教程进行操作,当我尝试运行 python manage.py runserver 时,我收到 Errno 10013: 尝试以访问权限禁止的方式访问套接字。

我使用的是 Windows 7,并以管理员身份运行 cmd.exe 控制台。有人可以用简单的英语解释一下如何解决这个问题吗?本教程的下一步表示访问 http://127.0.0.1:8000/ 并且应该显示欢迎使用 Django,但我的只是出现错误。

预先感谢您的帮助。

So I'm a relative novice with Python, and just tried installing and running Django today. I'm working my way through the official tutorial, and when I try to run the python manage.py runserver I get Errno 10013: an attempt was made to access a socket in a way forbidden by its access permissions.

I am using Windows 7, and am running the cmd.exe console as an administrator. Could someone please explain how to fix this in plain english? The next step in the tutorial says to visit http://127.0.0.1:8000/ and that it should say Welcome to Django, but mine just brings up an error.

Thanks in advance for the help.

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

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

发布评论

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

评论(4

赏烟花じ飞满天 2024-12-25 15:09:25

我遇到了同样的问题,我通过以管理员身份在 cmd 中运行下面的代码来修复它(要以管理员身份运行,右键单击 powershell 并选择“以管理员身份运行”)。

python manage.py runserver 8080

I had the same problem and I fixed it by running the code below in the cmd as an admin (to run as admin, right click on the powershell and and select 'run as admin').

python manage.py runserver 8080
霓裳挽歌倾城醉 2024-12-25 15:09:25

也许这是因为某些进程正在使用此端口,因此只需终止此端口并再次运行即可。

  1. go cmd
  2. netstat -a -n -o

在本地地址栏下找到你的端口号。如果你找到了,检查PID栏。你会看到哪个进程正在使用这个端口

  1. taskkill /f /im [PID]

即。

Maybe this is because of some process is using this port so just kill this port and run again.

  1. go cmd
  2. netstat -a -n -o

Find your port number under the local address column.If u found,check the PID column.U will see which process is using this port

  1. taskkill /f /im [PID]

That is.

岛徒 2024-12-25 15:09:25

虽然我没有安装 McAfee,也没有使用 Windows 7(两者都容易出现问题),但在运行“python manage.py runserver”行时遇到了问题。我收到错误“10013”。解决方案相当简单。首先,运行“netstat -ano |”行findstr 127.0.0.1:8000',它会检查你的端口的线路。如果该命令产生任何类型的消息,那么您应该更改您正在使用的端口。这可以通过在原始“runserver”命令的末尾添加一个四位数来完成。

例子:
python 管理.py runserver 7000
在上面的示例中,正在使用的端口更改为端口 7000。

While I do not have McAfee installed, nor do am I on Windows 7 (both of which tend to problematic), I had an issue when running the line 'python manage.py runserver'. I had been receiving the error '10013'. The solution was moderately simple. To begin, run the line 'netstat -ano | findstr 127.0.0.1:8000', which checks the line of your port. If the command resulted in a message of any sort, then you ought to change the port which you're using. This can be done by adding a four digit number to the end of the original 'runserver' command.

Example:
python manage.py runserver 7000
In the above example, the port being used was changed to port 7000.

很快妥协 2024-12-25 15:09:24

默认端口可能在另一个程序中打开。请尝试以下操作:

python manage.py runserver 8080

如果不起作用,则可能是权限问题。有些人报告说仅以管理员身份运行 cmd.exe 是不够的。有一些修复程序可以解决此问题,但它们很烦人,并且可能表明您的 Python 安装有些奇怪。首先尝试端口修复:-)

编辑:刚刚读了一篇博客文章,说这对于运行 Aptana/PyDev 的人来说很常见。 Aptana 的内部网络服务器使用端口 8000,这是 Django 默认值。

The default port might be open in another program. Try the following:

python manage.py runserver 8080

If that doesn't work, it might be a permissions problem. Some people have reported that just running cmd.exe as admin isn't enough. There are a few fixes for this, but they're annoying and probably indicate something's weird with your Python install. Try the port fix first :-)

EDIT: Just read a blog post saying this is very common with folks running Aptana/PyDev. Aptana's internal webserver uses port 8000, which is the Django default.

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