[Python] Python3 venv version AND system version?

Discussão em 'Python' iniciado por Stack, Janeiro 28, 2025.

  1. Stack

    Stack Membro Participativo

    Mac Mini M1.

    Hi, I am trying to setup Google Calendar API. I followed every step explained in ...see documentation

    When running the quickstart.py script given as sample (see here) I got errors :

    Traceback (most recent call last):
    File "/Users/matt/bin/scripts/calendar/quickstart.py", line 70, in <module>
    main()
    File "/Users/matt/bin/scripts/calendar/quickstart.py", line 32, in main
    creds = flow.run_local_server(0)
    ^^^^^^^^^^^^^^^^^^^^^^^^
    File "/Users/matt/bin/scripts/calendar/lib/python3.11/site-packages/google_auth_oauthlib/flow.py", line 432, in run_local_server
    local_server = wsgiref.simple_server.make_server(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/wsgiref/simple_server.py", line 154, in make_server
    server = server_class((host, port), handler_class)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/socketserver.py", line 456, in __init__
    self.server_bind()
    File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/wsgiref/simple_server.py", line 50, in server_bind
    HTTPServer.server_bind(self)
    File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/server.py", line 136, in server_bind
    socketserver.TCPServer.server_bind(self)
    File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/socketserver.py", line 472, in server_bind
    self.socket.bind(self.server_address)
    TypeError: str, bytes or bytearray expected, not int


    What puzzles me is why the libs jump outside my virtual environment (set to '/Users/matt/bin/scripts/calendar') and referencing the system wide python3 (/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11) ?

    I checked for a shell alias that could interfere... nope.

    Any ideas ?

    Thanks

    Continue reading...

Compartilhe esta Página