Does PsychoPy3 only function with an internet connection?

Hello everyone,

I’m using stanalone PsychoPy v3.0.2. My computer is not connected to the internet while the study runs. When I try to open the app when not online, the app is closed again after the tipps window shows up. Only on the second or third try to open the app does the app stay open and shows the error below.
Has PsychoPy changed from 2.7 to 3 so that it now always requires an internet connection, or can I change something in my preferences to not search for a connection?

Exception in thread Thread-6:
Traceback (most recent call last):
  File "C:\Program Files (x86)\PsychoPy3\lib\site-packages\urllib3\connection.py", line 141, in _new_conn
    (self.host, self.port), self.timeout, **extra_kw)
  File "C:\Program Files (x86)\PsychoPy3\lib\site-packages\urllib3\util\connection.py", line 60, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "C:\Program Files (x86)\PsychoPy3\lib\socket.py", line 745, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11001] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files (x86)\PsychoPy3\lib\site-packages\urllib3\connectionpool.py", line 601, in urlopen
    chunked=chunked)
  File "C:\Program Files (x86)\PsychoPy3\lib\site-packages\urllib3\connectionpool.py", line 357, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "C:\Program Files (x86)\PsychoPy3\lib\http\client.py", line 1239, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "C:\Program Files (x86)\PsychoPy3\lib\http\client.py", line 1285, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "C:\Program Files (x86)\PsychoPy3\lib\http\client.py", line 1234, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "C:\Program Files (x86)\PsychoPy3\lib\http\client.py", line 1026, in _send_output
    self.send(msg)
  File "C:\Program Files (x86)\PsychoPy3\lib\http\client.py", line 964, in send
    self.connect()
  File "C:\Program Files (x86)\PsychoPy3\lib\site-packages\urllib3\connection.py", line 166, in connect
    conn = self._new_conn()
  File "C:\Program Files (x86)\PsychoPy3\lib\site-packages\urllib3\connection.py", line 150, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x171A1390>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files (x86)\PsychoPy3\lib\site-packages\requests\adapters.py", line 440, in send
    timeout=timeout
  File "C:\Program Files (x86)\PsychoPy3\lib\site-packages\urllib3\connectionpool.py", line 639, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "C:\Program Files (x86)\PsychoPy3\lib\site-packages\urllib3\util\retry.py", line 388, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='news.psychopy.org', port=80): Max retries exceeded with url: /news_items.json (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x171A1390>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files (x86)\PsychoPy3\lib\threading.py", line 916, in _bootstrap_inner
    self.run()
  File "C:\Program Files (x86)\PsychoPy3\lib\threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Program Files (x86)\PsychoPy3\lib\site-packages\psychopy\app\connections\news.py", line 22, in getNewsItems
    resp = requests.get(url)
  File "C:\Program Files (x86)\PsychoPy3\lib\site-packages\requests\api.py", line 72, in get
    return request('get', url, params=params, **kwargs)
  File "C:\Program Files (x86)\PsychoPy3\lib\site-packages\requests\api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "C:\Program Files (x86)\PsychoPy3\lib\site-packages\requests\sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "C:\Program Files (x86)\PsychoPy3\lib\site-packages\requests\sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "C:\Program Files (x86)\PsychoPy3\lib\site-packages\requests\adapters.py", line 508, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='news.psychopy.org', port=80): Max retries exceeded with url: /news_items.json (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x171A1390>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',))

3.3961     WARNING     Tried to log in to Pavlovia but no network connection
5.8193     WARNING     Couldn't connect to psychopy.org
Check internet settings (and proxy setting in PsychoPy Preferences.

Ah, not deliberate. I can certainly imagine what the problem is though and should be fine to fix quickly. Thanks for the full and informative error report.

1 Like

@LukasPsy We use PsychoPy3 on standalone machines w/o a problem. We installed it using a conda environment, so maybe there’s a difference there? I’m using a slight modification of environment-3.6.yml on the GitHub site.

Thank you @tjwilli58 for the advice.
I won’t switch to a conda enviroment for this study, but I might in the future. :+1:

Ok, yes. I confrimed that problem and fixed it in https://github.com/psychopy/psychopy/pull/2256/commits/acd27c759f1613b7c398e4bd5d7231c444eb7671

That will be included in 3.0.4 bugdfix release (v soon).

I think the conda package is misleading - I think it should probably fail there too if using 3.0.2. My guess is that tjwilli58 is using one of the PsychoPy3 beta versions (which didn’t have this buglet).

1 Like

@jon, That’s correct. We’re currently using 3.0.0b12.
I’m glad to see that this bug has been found and fixed before we upgraded to the latest version. We definitely need PsychoPy to work offline!

@jon, I hope this is the correct thread for posting my issue… I should also say that I’m a psychopy newbie. My psychopy3 experiment wont launch due to the following error message in my output:

Welcome to PsychoPy3!
v3.2.3
Traceback (most recent call last):
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\app\stdOutRich.py”, line 157, in onURL
self.parent.onURL(evt) # just pass this one on
AttributeError: ‘NoneType’ object has no attribute ‘onURL’

Then there is also this message:

pygame 1.9.4
Hello fomr the pygame community. http://www.pygame.org/contribute.html
28.9116 WARNING Couldn’t connect to psychopy.org
Check internet settings (and proxy setting in Psychopy Prefrences.

Is this a proxy issue? I should also say that I am sitting behind my institutes proxy and firewall…

Is there anything that can be done?

Thanks!