Why does the Google Calendar Quickstart for Python give me an OSError (WinError 10013) (access socket in a way forbidden)2019 Community Moderator ElectionHow to run python script with elevated privilege on windowssocket.error: [Errno 10013] An attempt was made to access a socket in a way forbidden by its access permissionssocket.error: [Errno 10013] An attempt was made to access a socket in a way forbidden by its access permissionsWhy does Python code run faster in a function?Python flask apps on LightTPD (Windows) get [Errno 10013] An attempt was made to access a socket in a way forbidden by its access permissionspython executable gives error 10013 :an attempt was made to access a socket in a way forbidden by its access permissionspython google-auth-oauthtool to get access tokenPython Selenium shows OS ErrorPython ftplib OSError: [WinError 10013] on STOR operationOSError: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissionsOSError: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions while running in PyCharm environmentsql server 2017 ml services python - access a socket in a way forbidden by its access permissions

Should I take out a loan for a friend to invest on my behalf?

Why would one plane in this picture not have gear down yet?

Are the terms "stab" and "staccato" synonyms?

Why the color red for the Republican Party

Making a sword in the stone, in a medieval world without magic

Could you please stop shuffling the deck and play already?

Does splitting a potentially monolithic application into several smaller ones help prevent bugs?

Low budget alien movie about the Earth being cooked

What to do when during a meeting client people start to fight (even physically) with each others?

How do I locate a classical quotation?

Are babies of evil humanoid species inherently evil?

Placing subfig vertically

Why does Captain Marvel assume the people on this planet know this?

Why is this plane circling around the Lucknow airport every day?

Why does Deadpool say "You're welcome, Canada," after shooting Ryan Reynolds in the end credits?

Is "history" a male-biased word ("his+story")?

How to pass a string to a command that expects a file?

Time travel short story where dinosaur doesn't taste like chicken

Do Bugbears' arms literally get longer when it's their turn?

Why would a jet engine that runs at temps excess of 2000°C burn when it crashes?

Is there an equal sign with wider gap?

Does "variables should live in the smallest scope as possible" include the case "variables should not exist if possible"?

Virginia employer terminated employee and wants signing bonus returned

Aliens englobed the Solar System: will we notice?



Why does the Google Calendar Quickstart for Python give me an OSError (WinError 10013) (access socket in a way forbidden)



2019 Community Moderator ElectionHow to run python script with elevated privilege on windowssocket.error: [Errno 10013] An attempt was made to access a socket in a way forbidden by its access permissionssocket.error: [Errno 10013] An attempt was made to access a socket in a way forbidden by its access permissionsWhy does Python code run faster in a function?Python flask apps on LightTPD (Windows) get [Errno 10013] An attempt was made to access a socket in a way forbidden by its access permissionspython executable gives error 10013 :an attempt was made to access a socket in a way forbidden by its access permissionspython google-auth-oauthtool to get access tokenPython Selenium shows OS ErrorPython ftplib OSError: [WinError 10013] on STOR operationOSError: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissionsOSError: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions while running in PyCharm environmentsql server 2017 ml services python - access a socket in a way forbidden by its access permissions










1















I followed Google's Quickstart for Python, step-by-step. I followed each step exactly, often copying and pasting. I definitely have the Google Calendar API enabled. I've installed the Google Client Library with Pip. I've set up the sample code and the credentials.json in its own folder. So, why am I getting this error when I run it:



"OSError: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions"


To figure this out, I've learned what a socket is. (It's literally the combination of an IP address and a single port). I've learned how to use netstat, though I don't know yet how this applies to what I'm doing. I've looked into using ShellExecuteEx based on an answer in this question, but I don't know how to use that with Python.



I've tried adding the script from the accepted answer to this question (which actually uses the ShellExecuteEx method though I don't notice this) into an admin.py file and import this admin.py script into quickstart.py. After updating the admin.py script to Python 3 syntax and running quickstart.py, Windows 8.1 asks me if I will allow access. I say yes, and it still gives me the OSError (WinError 10013) on accessing the socket in a forbidden way. The UAC is not the issue.



I suspect it's a port conflict, where something's already using the port that the script that Google's trying to use. But I'm worried that the port is decided by a black box function that I won't be able to change. The error itself doesn't say which port it's using, so I'll need to do more research.










share|improve this question




























    1















    I followed Google's Quickstart for Python, step-by-step. I followed each step exactly, often copying and pasting. I definitely have the Google Calendar API enabled. I've installed the Google Client Library with Pip. I've set up the sample code and the credentials.json in its own folder. So, why am I getting this error when I run it:



    "OSError: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions"


    To figure this out, I've learned what a socket is. (It's literally the combination of an IP address and a single port). I've learned how to use netstat, though I don't know yet how this applies to what I'm doing. I've looked into using ShellExecuteEx based on an answer in this question, but I don't know how to use that with Python.



    I've tried adding the script from the accepted answer to this question (which actually uses the ShellExecuteEx method though I don't notice this) into an admin.py file and import this admin.py script into quickstart.py. After updating the admin.py script to Python 3 syntax and running quickstart.py, Windows 8.1 asks me if I will allow access. I say yes, and it still gives me the OSError (WinError 10013) on accessing the socket in a forbidden way. The UAC is not the issue.



    I suspect it's a port conflict, where something's already using the port that the script that Google's trying to use. But I'm worried that the port is decided by a black box function that I won't be able to change. The error itself doesn't say which port it's using, so I'll need to do more research.










    share|improve this question


























      1












      1








      1








      I followed Google's Quickstart for Python, step-by-step. I followed each step exactly, often copying and pasting. I definitely have the Google Calendar API enabled. I've installed the Google Client Library with Pip. I've set up the sample code and the credentials.json in its own folder. So, why am I getting this error when I run it:



      "OSError: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions"


      To figure this out, I've learned what a socket is. (It's literally the combination of an IP address and a single port). I've learned how to use netstat, though I don't know yet how this applies to what I'm doing. I've looked into using ShellExecuteEx based on an answer in this question, but I don't know how to use that with Python.



      I've tried adding the script from the accepted answer to this question (which actually uses the ShellExecuteEx method though I don't notice this) into an admin.py file and import this admin.py script into quickstart.py. After updating the admin.py script to Python 3 syntax and running quickstart.py, Windows 8.1 asks me if I will allow access. I say yes, and it still gives me the OSError (WinError 10013) on accessing the socket in a forbidden way. The UAC is not the issue.



      I suspect it's a port conflict, where something's already using the port that the script that Google's trying to use. But I'm worried that the port is decided by a black box function that I won't be able to change. The error itself doesn't say which port it's using, so I'll need to do more research.










      share|improve this question
















      I followed Google's Quickstart for Python, step-by-step. I followed each step exactly, often copying and pasting. I definitely have the Google Calendar API enabled. I've installed the Google Client Library with Pip. I've set up the sample code and the credentials.json in its own folder. So, why am I getting this error when I run it:



      "OSError: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions"


      To figure this out, I've learned what a socket is. (It's literally the combination of an IP address and a single port). I've learned how to use netstat, though I don't know yet how this applies to what I'm doing. I've looked into using ShellExecuteEx based on an answer in this question, but I don't know how to use that with Python.



      I've tried adding the script from the accepted answer to this question (which actually uses the ShellExecuteEx method though I don't notice this) into an admin.py file and import this admin.py script into quickstart.py. After updating the admin.py script to Python 3 syntax and running quickstart.py, Windows 8.1 asks me if I will allow access. I say yes, and it still gives me the OSError (WinError 10013) on accessing the socket in a forbidden way. The UAC is not the issue.



      I suspect it's a port conflict, where something's already using the port that the script that Google's trying to use. But I'm worried that the port is decided by a black box function that I won't be able to change. The error itself doesn't say which port it's using, so I'll need to do more research.







      python python-3.x






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 7 at 7:39







      Aaron Bell

















      asked Mar 7 at 1:48









      Aaron BellAaron Bell

      715




      715






















          1 Answer
          1






          active

          oldest

          votes


















          0














          It is a port issue.



          • Go to line 34 on the quickstart.py file (or where it says creds =
            run_local_server()).

          • Go to the flow.py file in the
            google_auth_oauthlib package with this function (in VS Code, click
            run_local_server() and press F12 or right click and select "Go to
            Definition").

          You'll see line 369 (at the time of this writing) say self, host='localhost', port=8080,.



          When I look at netstat, it actually says this port is in use, probably with an Apache server I never turned off.



          Netstat TCP Port 8080, LISTENING



          • Change the value in the flow.py file in the google_auth_oauthlib package to 8090, so 369 looks like self, host='localhost', port=8090,.

          I ran the quickstart.py script again, and the window to authenticate my Google account popped up.



          I selected my account, and it worked. No messing with the admin stuff.



          I'm glad I was able to find it like this because I thought the port was selected in some black box manner, like it was decided from a server at Google.






          share|improve this answer






















            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55034837%2fwhy-does-the-google-calendar-quickstart-for-python-give-me-an-oserror-winerror%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            It is a port issue.



            • Go to line 34 on the quickstart.py file (or where it says creds =
              run_local_server()).

            • Go to the flow.py file in the
              google_auth_oauthlib package with this function (in VS Code, click
              run_local_server() and press F12 or right click and select "Go to
              Definition").

            You'll see line 369 (at the time of this writing) say self, host='localhost', port=8080,.



            When I look at netstat, it actually says this port is in use, probably with an Apache server I never turned off.



            Netstat TCP Port 8080, LISTENING



            • Change the value in the flow.py file in the google_auth_oauthlib package to 8090, so 369 looks like self, host='localhost', port=8090,.

            I ran the quickstart.py script again, and the window to authenticate my Google account popped up.



            I selected my account, and it worked. No messing with the admin stuff.



            I'm glad I was able to find it like this because I thought the port was selected in some black box manner, like it was decided from a server at Google.






            share|improve this answer



























              0














              It is a port issue.



              • Go to line 34 on the quickstart.py file (or where it says creds =
                run_local_server()).

              • Go to the flow.py file in the
                google_auth_oauthlib package with this function (in VS Code, click
                run_local_server() and press F12 or right click and select "Go to
                Definition").

              You'll see line 369 (at the time of this writing) say self, host='localhost', port=8080,.



              When I look at netstat, it actually says this port is in use, probably with an Apache server I never turned off.



              Netstat TCP Port 8080, LISTENING



              • Change the value in the flow.py file in the google_auth_oauthlib package to 8090, so 369 looks like self, host='localhost', port=8090,.

              I ran the quickstart.py script again, and the window to authenticate my Google account popped up.



              I selected my account, and it worked. No messing with the admin stuff.



              I'm glad I was able to find it like this because I thought the port was selected in some black box manner, like it was decided from a server at Google.






              share|improve this answer

























                0












                0








                0







                It is a port issue.



                • Go to line 34 on the quickstart.py file (or where it says creds =
                  run_local_server()).

                • Go to the flow.py file in the
                  google_auth_oauthlib package with this function (in VS Code, click
                  run_local_server() and press F12 or right click and select "Go to
                  Definition").

                You'll see line 369 (at the time of this writing) say self, host='localhost', port=8080,.



                When I look at netstat, it actually says this port is in use, probably with an Apache server I never turned off.



                Netstat TCP Port 8080, LISTENING



                • Change the value in the flow.py file in the google_auth_oauthlib package to 8090, so 369 looks like self, host='localhost', port=8090,.

                I ran the quickstart.py script again, and the window to authenticate my Google account popped up.



                I selected my account, and it worked. No messing with the admin stuff.



                I'm glad I was able to find it like this because I thought the port was selected in some black box manner, like it was decided from a server at Google.






                share|improve this answer













                It is a port issue.



                • Go to line 34 on the quickstart.py file (or where it says creds =
                  run_local_server()).

                • Go to the flow.py file in the
                  google_auth_oauthlib package with this function (in VS Code, click
                  run_local_server() and press F12 or right click and select "Go to
                  Definition").

                You'll see line 369 (at the time of this writing) say self, host='localhost', port=8080,.



                When I look at netstat, it actually says this port is in use, probably with an Apache server I never turned off.



                Netstat TCP Port 8080, LISTENING



                • Change the value in the flow.py file in the google_auth_oauthlib package to 8090, so 369 looks like self, host='localhost', port=8090,.

                I ran the quickstart.py script again, and the window to authenticate my Google account popped up.



                I selected my account, and it worked. No messing with the admin stuff.



                I'm glad I was able to find it like this because I thought the port was selected in some black box manner, like it was decided from a server at Google.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 7 at 1:48









                Aaron BellAaron Bell

                715




                715





























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55034837%2fwhy-does-the-google-calendar-quickstart-for-python-give-me-an-oserror-winerror%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme

                    Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

                    2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived