Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Can't run PsychoPy after conda installation on Mac Sonoma #6267

Open
FelixMoto opened this issue Feb 23, 2024 · 6 comments
Open

[Bug]: Can't run PsychoPy after conda installation on Mac Sonoma #6267

FelixMoto opened this issue Feb 23, 2024 · 6 comments
Labels
🐞 bug Issue describes a bug (crash or error) or undefined behavior.

Comments

@FelixMoto
Copy link

FelixMoto commented Feb 23, 2024

PsychoPy Version

2022.2.5

What OS are your PsychoPy running on?

macOS Silicon

Bug Description

I followed the installation instructions to create a conda psychopy environment as described on the website. For this i had to change the requested python version line in the .yml to python>=3.8 as suggested in another issue.
When running psychopy in the command line after activating the created environment i get the error that you can see in the attached file. When running import in a python file I get the No module names 'psychopy' error.

Currently I am running on a November 2023 MacBook Pro with Sonoma 14.3.1
and have installed PsychoPy 2022.2.5
My python version in the environment is Python 3.10.13 and Conda 23.10.0

If I have missed something obvious or the issue is already known, please point me in the right direction. Thanks

Expected Behaviour

Seamless installation of the psychopy package (I guess) and working with psychopy in Visual Studio code.

Steps to Reproduce

  1. Download psychopy-env.yml
  2. Change python=3.8 to python>=3.8
  3. Run installation command conda env create -n psychopy -f psychopy-env.yml
  4. Activate psychopy environment
  5. Run psychopy
  6. get error mentioned above

Additional context

No response

@FelixMoto FelixMoto added the 🐞 bug Issue describes a bug (crash or error) or undefined behavior. label Feb 23, 2024
@peircej
Copy link
Member

peircej commented Feb 23, 2024

Is there a reason you can't just install Standalone PsychoPy? That will work. In my experience, too many things go wrong with conda python packages and we don't have time for the core staff to go fixing them.

@tomdstone
Copy link
Contributor

tomdstone commented Feb 23, 2024

For this i had to change the requested python version line in the .yml to python>=3.8 as suggested in another issue. When running psychopy in the command line after activating the created environment i get the error that you can see in the attached file. When running import in a python file I get the No module names 'psychopy' error.

Hello, I authored the issue #6261, and I can confirm at least that the command line run of psychopy doesn't work for me, generating the same sort of error, but I am able to import it in python verison 3.10.13. I'm not too bummed about it and will probably just adapt to using the standalone installer to launch the standalone as I'm new to Psychopy and just did the conda install because that's what I was used to doing.

@FelixMoto
Copy link
Author

@peircej Not specifically, but generally I much rather prefer working in my IDE than in psychopy's own coder for multiple reasons. Nevertheless, working with the stand-alone application is a reasonable alternative nonetheless.

@tomdstone Same for me. I just tried installing psychopy using pip, which initially gave me an error that it does not find hdf5. So I installed hdf5 using
brew install hdf5
and then setting the path to it's directory
export HDF5_DIR=/opt/homebrew/opt/hdf5
I think the issue here is that homebrew installs hdf5 in a directory where conda does not find it.
Then I ran
conda create -n psychopy python=3.10.13
conda activate psychopy
pip install psychopy

So far it seems to work and I can run psychopy from my VS Code. Maybe that works for you as well.

@tomdstone
Copy link
Contributor

Right I completely forgot that I had to install HDF5 too

@susanBuck
Copy link

I was also having issues getting PsychoPy installed with conda using the instructions from the Install page. I put together a video of the approach that eventually worked for me: PsychoPy - Manual install via Conda (PsychoPy in VSCode)

@peircej
Copy link
Member

peircej commented Mar 7, 2024

Thanks @susanBuck
Just, for anyone visitng this thread, I'd be happy to see pull requests that either

  1. improve the conda env file
  2. improve the installation (e.g. explaining that conda+psychopy is best with 3.10)
  3. go the whole hog and fix the condaforge release so that conda install psychopy works as well

(Maybe the first point on (3) is to point out that conda support for psychopy is community-based support)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Issue describes a bug (crash or error) or undefined behavior.
Projects
None yet
Development

No branches or pull requests

4 participants