初学者安装/运行 Django...Errno 10013?
所以我对 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我遇到了同样的问题,我通过以管理员身份在 cmd 中运行下面的代码来修复它(要以管理员身份运行,右键单击 powershell 并选择“以管理员身份运行”)。
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').
也许这是因为某些进程正在使用此端口,因此只需终止此端口并再次运行即可。
在本地地址栏下找到你的端口号。如果你找到了,检查PID栏。你会看到哪个进程正在使用这个端口
即。
Maybe this is because of some process is using this port so just kill this port and run again.
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
That is.
虽然我没有安装 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.
默认端口可能在另一个程序中打开。请尝试以下操作:
如果不起作用,则可能是权限问题。有些人报告说仅以管理员身份运行 cmd.exe 是不够的。有一些修复程序可以解决此问题,但它们很烦人,并且可能表明您的 Python 安装有些奇怪。首先尝试端口修复:-)
编辑:刚刚读了一篇博客文章,说这对于运行 Aptana/PyDev 的人来说很常见。 Aptana 的内部网络服务器使用端口 8000,这是 Django 默认值。
The default port might be open in another program. Try the following:
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.