socket.error: [Errno 10013] An attempt was made to access a socket in a way forbidden by its access permissions
On Windows Vista/7, with UAC, administrator accounts run programs in unprivileged mode by default.
Programs must prompt for administrator access before they run as administrator, with the ever-so-familiar UAC dialog. Since Python scripts aren't directly executable, there's no "Run as Administrator" context menu option.
It's possible to use ctypes.windll.shell32.IsUserAnAdmin()
to detect whether the script has admin access, and ShellExecuteEx
with the 'runas' verb on python.exe, with sys.argv[0] as a parameter to prompt the UAC dialog if needed.
OSError: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions.What to do?
Try localhost, if host is not working. Like for eg. host='127.0.0.1' #( The server's hostname or IP address)and use a port >1023 (As those are non-privileged ports)
If its still not working, you can try changing your network and try the same steps. If any further issue occurs regarding the same error there must be a issue with your system, for that try factory reset. Then it will work 100%
Best of luck.
pymongo: [Errno 10013] An attempt was made to access a socket in a way forbidden by its access permissions
the problem was with the antivirus.. I have comodo antivirus and it has been blocking the scripts,, I unblocked them and now they work :)
An attempt was made to access a socket in a way forbidden by its access permissions (Bottle) (Python)
Does this problem go away when you try port 8000 instead of 80?
You're trying to bind to port 80. I don't know Windows, but on Linux your code would fail because port 80 (like all ports below 1024) is privileged--only root can bind to them. That's why you'll see most tutorials and web framework defaults use a high port number, typically 8000
or 8080
.
References:
https://www.w3.org/Daemon/User/Installation/PrivilegedPorts.html
https://en.wikipedia.org/wiki/Registered_port
An attempt was made to access a socket in a way forbidden by its access permissions. Why?
Most likely the socket is held by some process. Use netstat -o
to find which one.
Related Topics
How to Get First Element in a List of Tuples
Python Sharing a Lock Between Processes
Cmd Opens Windows Store When I Type 'Python'
How to Decode Base64 Data in Python
Matplotlib Scatter Plot Legend
Choosing a File in Python with Simple Dialog
Python 3: Importerror "No Module Named Setuptools"
Seaborn Is Not Plotting Within Defined Subplots
Not Letting the Character Move Out of the Window
How to Print to Stderr in Python
Traverse a List in Reverse Order in Python
Access Elementtree Node Parent Node
Draw a Transparent Rectangles and Polygons in Pygame
Dynamically Add Field to a Form
How to Get the Ip Address from a Nic (Network Interface Controller) in Python