Cannot log in to Pavlovia from PsychoPy

OS (e.g. Win10): Win11
PsychoPy version (e.g. 2024.2.4 Py 3.8): I’ve tried 2026.1.1 and 2025.2.4
Standard Standalone Installation? y
URL of experiment:
Do you want it to also run locally? y
What are you trying to achieve?: I am a brand new PsychoPy user trying to push a task online. It runs fine locally. I have set up an account on Pavlovia. But I get an “unhandled internal error” when I try to log in to Pavlovia from PsychoPy.

What did you try to make it work?: I have consulted experienced PsychoPy users, but they have never encountered this error. I have uninstalled and reinstalled PsychoPy. I have uninstalled the 2026 version and installed an older version. I have restarted my computer. I have turned off the company VPN. No matter what, I get the same error. I window pops up that seems to indicate that I am signed in to Pavlovia, but then I get a message that I am not signed in and the error pops up all over again.

Link to the most relevant existing thread you have found: I found other threads talking about similar errors, but none that clearly explained how the error was resolved.

Here is the error message (although I edited my user name and all of the cases that referred to gitlab.pavlovia.org because as a new forum user I’m blocked from posting more than one link)
A window pops up that says:
PsychoPy encountered an unhandled internal error!

The details section says:

Traceback (most recent call last):
File “C:\Users\myusername\AppData\Local\Programs\PsychoPy\lib\site-packages\urllib3\connectionpool.py”, line 464, in _make_request
self._validate_conn(conn)
File “C:\Users\myusername\AppData\Local\Programs\PsychoPy\lib\site-packages\urllib3\connectionpool.py”, line 1093, in _validate_conn
conn.connect()
File “C:\Users\myusername\AppData\Local\Programs\PsychoPy\lib\site-packages\urllib3\connection.py”, line 796, in connect
sock_and_verified = _ssl_wrap_socket_and_match_hostname(
File “C:\Users\myusername\AppData\Local\Programs\PsychoPy\lib\site-packages\urllib3\connection.py”, line 975, in ssl_wrap_socket_and_match_hostname
ssl_sock = ssl_wrap_socket(
File "C:\Users\myusername\AppData\Local\Programs\PsychoPy\lib\site-packages\urllib3\util\ssl
.py", line 483, in ssl_wrap_socket
ssl_sock = ssl_wrap_socket_impl(sock, context, tls_in_tls, server_hostname)
File "C:\Users\myusername\AppData\Local\Programs\PsychoPy\lib\site-packages\urllib3\util\ssl
.py", line 527, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
File “C:\Users\myusername\AppData\Local\Programs\PsychoPy\lib\ssl.py”, line 513, in wrap_socket
return self.sslsocket_class._create(
File “C:\Users\myusername\AppData\Local\Programs\PsychoPy\lib\ssl.py”, line 1071, in _create
self.do_handshake()
File “C:\Users\myusername\AppData\Local\Programs\PsychoPy\lib\ssl.py”, line 1342, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “C:\Users\myusername\AppData\Local\Programs\PsychoPy\lib\site-packages\urllib3\connectionpool.py”, line 787, in urlopen
response = self._make_request(
File “C:\Users\myusername\AppData\Local\Programs\PsychoPy\lib\site-packages\urllib3\connectionpool.py”, line 488, in _make_request
raise new_e
urllib3.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “C:\Users\myusername\AppData\Local\Programs\PsychoPy\lib\site-packages\requests\adapters.py”, line 644, in send
resp = conn.urlopen(
File “C:\Users\myusername\AppData\Local\Programs\PsychoPy\lib\site-packages\urllib3\connectionpool.py”, line 841, in urlopen
retries = retries.increment(
File “C:\Users\myusername\AppData\Local\Programs\PsychoPy\lib\site-packages\urllib3\util\retry.py”, line 519, in increment
raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host=‘gitlab.pavlovia’, port=443): Max retries exceeded with url: /oauth/token?client_id=944b87ee0e6b4f510881d6f6bc082f64c7bba17d305efdb829e6e0e7ed466b34&code=eea5c944fee20877f50e855b90d6814b7d2f8d0d43a6b9a8c588694f4ab8a8fb&grant_type=authorization_code&redirect_uri=https%3A%2F%2Fgitlab.pavlovia%2F&code_verifier=mBFSfuq8bnHs3o9G9u8ghaW4UrQEU0QxQgql56RU8wxqsHVMJmQOhQOUnHjgLSI18lmmXkjJ9MhkOtWbD9_gn (Caused by SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)’)))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “C:\Users\myusername\AppData\Local\Programs\PsychoPy\lib\site-packages\psychopy\app\pavlovia_ui_base.py”, line 136, in getAccessTokenFromURL
resp = requests.post(
File “C:\Users\myusername\AppData\Local\Programs\PsychoPy\lib\site-packages\requests\api.py”, line 115, in post
return request(“post”, url, data=data, json=json, **kwargs)
File “C:\Users\myusername\AppData\Local\Programs\PsychoPy\lib\site-packages\requests\api.py”, line 59, in request
return session.request(method=method, url=url, **kwargs)
File “C:\Users\myusername\AppData\Local\Programs\PsychoPy\lib\site-packages\requests\sessions.py”, line 589, in request
resp = self.send(prep, **send_kwargs)
File “C:\Users\myusername\AppData\Local\Programs\PsychoPy\lib\site-packages\requests\sessions.py”, line 703, in send
r = adapter.send(request, **kwargs)
File “C:\Users\myusername\AppData\Local\Programs\PsychoPy\lib\site-packages\requests\adapters.py”, line 675, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host=‘gitlab.pavlovia’, port=443): Max retries exceeded with url: /oauth/token?client_id=944b87ee0e6b4f510881d6f6bc082f64c7bba17d305efdb829e6e0e7ed466b34&code=eea5c944fee20877f50e855b90d6814b7d2f8d0d43a6b9a8c588694f4ab8a8fb&grant_type=authorization_code&redirect_uri=https%3A%2F%2Fgitlab.pavlovia%2F&code_verifier=mBFSfuq8bnHs3o9G9u8ghaW4UrQEU0QxQgql56RU8wxqsHVMJmQOhQOUnHjgLSI18lmmXkjJ9MhkOtWbD9_gn (Caused by SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)’)))

Hello @lwlwl

Since you are on Windows 11, this SSLCertVerificationError usually means that PsychoPy’s internal Python environment is being blocked from verifying Pavlovia’s security certificate. What’s happening is that the OAuth login flow partially works: the sign-in window opens, your credentials are accepted, and Pavlovia sends an authorization code back to PsychoPy. But then PsychoPy tries to exchange that code for an access token via a POST request to gitlab.pavlovia.org – and that HTTPS connection fails because of the SSL certificate error. So PsychoPy never actually receives the token, and treats you as not signed in.

You can see this in the traceback – the error occurs in pavlovia_ui_base.py at getAccessTokenFromURL, which is exactly that final token exchange step.

This is probably caused by an institutional network proxy or antivirus software that intercepts HTTPS traffic.

Step 1 – Quick test: Try syncing via a mobile hotspot, bypassing your institution’s network entirely. If it works immediately, the network proxy is confirmed as the cause.

Step 2 – Fix: Add your institution’s certificate to PsychoPy. Locate this file: cacert.pem
It is in

C:\Users\<yourname>\AppData\Local\Programs\PsychoPy\Lib\site-packages\certifi\cacert.pem```

or

C:\Program Files\PsychoPy\Lib\site-packages\certifi (admin-rights required)

Get your institution’s root certificate from your IT department (usually a `.crt` or `.pem` file), open it as plain text, and append its contents to the end of `cacert.pem`. This tells PsychoPy to trust your institution’s proxy certificate.

Step 3 – Alternative: Set environment variable
If your IT provides a full certificate bundle:

set REQUESTS_CA_BUNDLE=C:\path\to\institution-cert.pem

Set this before launching PsychoPy.

I hope that helps. Good luck

Jens