Python Forum
WSAStartup error with requests - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Networking (https://python-forum.io/forum-12.html)
+--- Thread: WSAStartup error with requests (/thread-32218.html)



WSAStartup error with requests - yllawwally - Jan-28-2021

I installed the requests library yesterday. However whenever I import it, I get a WSAStartup failed: error code 10107. I am running python Python 3.8.6 (tags/v3.8.6:db45529, Sep 23 2020, 15:52:53) [MSC v.1927 64 bit (AMD64)] on win32, on Windows 10.

I could find very little on google about this error. I did try netsh winsock reset, and rebooted my pc. Does anyone have any other suggestions?


Error:
Traceback (most recent call last): File "getstats.py", line 1, in <module> import requests, json, datetime, sys File "C:\Users\wally\AppData\Local\Programs\Python\Python38\lib\site-packages\requests\__init__.py", line 43, in <module> import urllib3 File "C:\Users\wally\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\__init__.py", line 11, in <module> from . import exceptions File "C:\Users\wally\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\exceptions.py", line 3, in <module> from .packages.six.moves.http_client import IncompleteRead as httplib_IncompleteRead File "C:\Users\wally\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\packages\six.py", line 199, in load_module mod = mod._resolve() File "C:\Users\wally\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\packages\six.py", line 113, in _resolve return _import_module(self.mod) File "C:\Users\wally\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\packages\six.py", line 82, in _import_module __import__(name) File "C:\Users\wally\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 71, in <module> import email.parser File "C:\Users\wally\AppData\Local\Programs\Python\Python38\lib\email\parser.py", line 12, in <module> from email.feedparser import FeedParser, BytesFeedParser File "C:\Users\wally\AppData\Local\Programs\Python\Python38\lib\email\feedparser.py", line 27, in <module> from email._policybase import compat32 File "C:\Users\wally\AppData\Local\Programs\Python\Python38\lib\email\_policybase.py", line 9, in <module> from email.utils import _has_surrogates File "C:\Users\wally\AppData\Local\Programs\Python\Python38\lib\email\utils.py", line 29, in <module> import socket File "C:\Users\wally\AppData\Local\Programs\Python\Python38\lib\socket.py", line 49, in <module> import _socket ImportError: WSAStartup failed: error code 10107



RE: WSAStartup error with requests - yllawwally - Feb-23-2021

For anyone else who might see this error. I found the issue. I needed to disable my firewall.

(Jan-28-2021, 03:51 PM)yllawwally Wrote: I installed the requests library yesterday. However whenever I import it, I get a WSAStartup failed: error code 10107. I am running python Python 3.8.6 (tags/v3.8.6:db45529, Sep 23 2020, 15:52:53) [MSC v.1927 64 bit (AMD64)] on win32, on Windows 10.

I could find very little on google about this error. I did try netsh winsock reset, and rebooted my pc. Does anyone have any other suggestions?


Error:
Traceback (most recent call last): File "getstats.py", line 1, in <module> import requests, json, datetime, sys File "C:\Users\wally\AppData\Local\Programs\Python\Python38\lib\site-packages\requests\__init__.py", line 43, in <module> import urllib3 File "C:\Users\wally\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\__init__.py", line 11, in <module> from . import exceptions File "C:\Users\wally\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\exceptions.py", line 3, in <module> from .packages.six.moves.http_client import IncompleteRead as httplib_IncompleteRead File "C:\Users\wally\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\packages\six.py", line 199, in load_module mod = mod._resolve() File "C:\Users\wally\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\packages\six.py", line 113, in _resolve return _import_module(self.mod) File "C:\Users\wally\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\packages\six.py", line 82, in _import_module __import__(name) File "C:\Users\wally\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 71, in <module> import email.parser File "C:\Users\wally\AppData\Local\Programs\Python\Python38\lib\email\parser.py", line 12, in <module> from email.feedparser import FeedParser, BytesFeedParser File "C:\Users\wally\AppData\Local\Programs\Python\Python38\lib\email\feedparser.py", line 27, in <module> from email._policybase import compat32 File "C:\Users\wally\AppData\Local\Programs\Python\Python38\lib\email\_policybase.py", line 9, in <module> from email.utils import _has_surrogates File "C:\Users\wally\AppData\Local\Programs\Python\Python38\lib\email\utils.py", line 29, in <module> import socket File "C:\Users\wally\AppData\Local\Programs\Python\Python38\lib\socket.py", line 49, in <module> import _socket ImportError: WSAStartup failed: error code 10107