Installing psychopy using pip - what's the latest recommendation since the option on the docs fails on most systems

I appreciate there are other posts on installation problems, and I’ve looked through most of them—many are old and no longer relevant.

What is the current recommendation to install via pip? I had problems and I’ve been assisting a group who all tried to install it and most of them failed! It’s a selection of Macs (some M1, some old chips) and Windows. So this is not a problem specific to one OS configuration.

I’m reluctant to go for the pip install --no-dependencies options and then install everything manually, but is that the only way to go?

Any help appreciated…

If you start with Python 3.8 then pip install should work on both mac and windows. If that fails then I’d like to know on what so we can fix. On linux, even with py3.8 there are a few more hoops like installing wxpython and settings permissions (described in the docs).

Using other versions of Python (e.g. 3.10, which I’m going to bet is what’s happening) is a known problem because we use a number of other packages that don’t routinely build wheels for all versions and then need compiling. Sorry, that’s beyond our ability to control.

The debate has always been between the vocal minority that want the standard pip install to provide a minimal installation so it can be more portable across “pythons” versus the quieter majority that want pip install to give them everything they need for all experiments (high-precision timing, eyetracker support etc…). This summer we will certainly revisit the entire packaging question to see what we can do around providing minimal required packages for standard install and then provide warnings to people to add other packages as needed. ie. I’m thinking of bending a bit further towards the minimalists on the basis that give-me-everythings can use Standalone :wink:

1 Like

This was all 3.8’s. I had a selection of participants all on different OS’s and setups, but I asked all of them to downgrade to 3.8.

I don’t have everyone else’s failure points as this was all on Zoom and I couldn’t spend time on everyone—instead I got them to install with --no-dependcies and then install individual modules as needed — although even that is tricky as in some instances, such as yaml, the error says yaml not found by they need to install yamlpy

in my case (macOS 12.4 M1, Python 3.8.5) it failed on pocketsphinx I think

I’m only on the periphery of this as this is not my field and I was merely dipping into PsychoPy to help some clients — once we managed to install it, it was fun to use!— so I’m not in a position to have a view on minimalist vs full installation.

However, for those (like my clients) who are new to Python and are using PsychoPy as a way into programming, these sorts of issues are a turn off. They’re already having to learn a lot as they’re at a beginner or intermediate stage.

I would assume that many (perhaps most?) who use the package do not use all the additional hardware but run experiments using keyboard and normal monitor only as hardware. But I may be wrong!

Don’t get me wrong. I know it’s a turn-off when things don’t work. The problem is how to make everything “just work” for every user. It turns out that problem is harder than it looks.

But yes, I can see now that pocketsphinx hasn’t built any wheels for Python3.8 :sob:
I guess we’ll need to move that one to “suggests” rather then “depends” for now so that people that don’t have compilers set up won’t get stuck

As I say, we will be giving this a thorough overhaul but even after that it won’t be perfect because our users are so varied in what they want

I’ve also been having an issue installing Psychopy via pip. I’ve tried on 2 different versions of Mac:

  • Monterey 12.4 (M1 chip)
  • Catalina 10.15.7 (inter chip)

Both produce the same error when I try to run pip install psychopy on a clean and newly created conda environment with Python 3.8.

Collecting psychopy
  Using cached PsychoPy-2022.2.0.zip (27.3 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [16 lines of output]
      /Users/sportsnoah14/opt/miniconda3/envs/psychopy/lib/python3.8/site-packages/setuptools/config/__init__.py:28: SetuptoolsDeprecationWarning: As setuptools moves its configuration towards `pyproject.toml`,
      `setuptools.config.read_configuration` became deprecated.
      
      For the time being, you can use the `setuptools.config.setupcfg` module
      to access a backward compatible API, but this module is provisional
      and might be removed in the future.
      
        warnings.warn(dedent(msg), SetuptoolsDeprecationWarning)
      /Users/sportsnoah14/opt/miniconda3/envs/psychopy/lib/python3.8/site-packages/setuptools/config/setupcfg.py:463: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
        warnings.warn(msg, warning_class)
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/vq/1jds3k710k9_s_53dyhffr7r0000gq/T/pip-install-2jca6o6h/psychopy_259c99e2a6b94c54b23164e79e0e38ca/setup.py", line 41, in <module>
          required.remove('pyqt5; python_version >= "3"')
      ValueError: list.remove(x): x not in list
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

This also occurs if I try to first download Psychopy distribution release from github and then run pip install . while in the Psychopy distribution folder.

The main reason I’m trying to install on a conda environment is so I can develop experiments and load psydat files (for later analysis) within Pycharm or some other Python IDE. Do you know if it’s possible to use the Python interpreter that comes with Psychopy standalone within Pycharm? I tried but not all packages are added to path when I do this. Though this is secondary to getting Psychopy installed via pip.

I’ve installed it using pip and used via PyCharm by first installing psychopy with no dependencies and then manually adding dependencies as and when I need them. It’s a pain, but it worked

Instructions for installation of PsychoPy (including pocketsphinx) on Apple Silicon Macs can be found here.

I’ve been having this exact same problem, please let me know if you have / do figure this out!

My solution was to install psychopy with no dependencies first using the --no-dependencies flag in pip, then to install modules manually as and when I get a ModuleNotFound error. It’s a pain, but it’s a one-off pain. Once you’ve installed all the modules you need, you’re set!