Richard Jahn
Richard Jahn

Reputation: 1

"Pip install psychopy" -> "Getting requirements to build ... error" in python 3.11 on Mac

When I try to use pip to install a package named psychopy on Mac I run into this error:

"Getting requirements to build wheel ... error error: subprocess-exited-with-error Getting requirements to build wheel did not run successfully."

It only happens when I try to install this certain package. Other packages install fine (e.g. numpy).

I am running python 3.11 on a M1 Mac (latest version). I am completly new to all of this so please let me know if you need more information and I appreciate any help. I know this is a common problem but I am struggeling to understand answers to question regarding HDF5 or build wheel error that dont explicitly regarding my problem.

I have already tried to set the datapath for HDF5 (export HDF5_DIR=//Users/richardjahn/Desktop/hdf/HDF5-1.14.2-Darwin.sh). Full error: ip install psychopy Collecting psychopy Using cached PsychoPy-2023.1.3.zip (27.3 MB) (...) Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [11 lines of output] :19: DeprecationWarning: pkg_resources is deprecated as an API. See ld: library not found for -lhdf5 clang: error: linker command failed with exit code 1 (use -v to see invocation) cpuinfo failed, assuming no CPU features: 'flags' * Using Python 3.11.4 (v3.11.4:d2340ef257, Jun 6 2023, 19:15:51) [Clang 13.0.0 (clang-1300.0.29.30)] * Found cython 3.0.2 * USE_PKGCONFIG: False .. ERROR:: Could not find a local HDF5 installation. You may need to explicitly state where your local HDF5 headers and library can be found by setting the HDF5_DIR environment variable or by using the --hdf5 command-line option. [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> See above for output.

Upvotes: 0

Views: 677

Answers (1)

Jon
Jon

Reputation: 1223

As you'll see recommended on the PsychoPy Downloads page the PsychoPy team provides a Standalone package designed to avoid the problems of installing dependencies some of which have to be compiled. That standalone app includes everything you need, including its own python distribution. Especially for new users it's best to install that, which will sit perfectly happily alongside any other python installations you have (e.g. for data analysis).

If you really need to use your own python then you should use Python version 3.8-3.10 intel version, as PsychoPy is not tested against Python3.11 at this point and some of the dependencies don't compile easily on M1 native (but happily run in rosetta mode using the intel binaries packaged in the Standalone installer).

Upvotes: 0

Related Questions