psychopy.org | Reference | Downloads | Github

Psychopy.info disappeared?

The API lists psychopy.info as containing a bunch of “functions for getting information about the system”, which is how I have always used it.

However, psychopy.info is not showing up for me when one calls
import psychopy

If one then executes
‘psychopy.info’, for example from the Psychopy IDE’s Shell, one gets this error:
AttributeError: module 'psychopy' has no attribute 'info'

even though psychopy.info is still in the API, and one can access psychopy.visual and the other modules from the Shell.

What gives?

2 Likes

What version of PsychoPy are you using? looks like that should still be accessible in the current release psychopy/info.py at release · psychopy/psychopy · GitHub

for me in 2021.1.4 this works for example

from psychopy import info
info.RunTimeInfo()
1 Like

Thanks Becca, sorry, I should have said - I’m using psychopy2021.1.4
Your example works, thank you, so I can use that!

However, as I said in my OP,
psychopy.info does not work on my machine or on my student’s,
even though psychopy.visual does work.
I don’t know how things become visible, but maybe there’s a problem in
psychopy/info/__init__.py
I will open a Github issue.

This is actually the expected behaviour. We could set up the psychopy/__init__.py to import all submodules in which case your code would work, but haven’t done that for many years because it means all of PsychoPy being imported when you import any part of it. With the notation:

from psychopy import info, visual, data

you can choose which parts of the package you import and for something as large as PsychoPy that’s important

1 Like

Ah ok, that makes sense, thanks for explaining that Jon!

Yes, I have noticed that PsychoPy has gotten very big - chock full o’ features :slight_smile:

1 Like