# Psychopy can't run on mac due to versions conflict?

**URL:** <https://discourse.psychopy.org/t/psychopy-cant-run-on-mac-due-to-versions-conflict/5314>\
**Category:** Other\
**Tags:** python3\
**Created:** [September 13, 2018, 5:45am UTC](https://discourse.psychopy.org/t/psychopy-cant-run-on-mac-due-to-versions-conflict/5314 "2018-09-13T05:45:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![doreenduo43](https://avatars.discourse-cdn.com/v4/letter/d/b487fb/32.png) [@doreenduo43](https://discourse.psychopy.org/u/doreenduo43)\
**Post date:** [September 13, 2018, 5:45am UTC](https://discourse.psychopy.org/t/psychopy-cant-run-on-mac-due-to-versions-conflict/5314/1 "2018-09-13T05:45:55Z")

</div>

Hello. Could you help me to solve my problem? Thanks a lot.  
I guess my problem is due to python versions conflict. The detail is as follows.

Environment

- MacBook Air
- OS:macOS Sierra 10.12.6

I already have the python 2.7.10 in my mac. It is the default version if I use the command line “python” to call python.  
I also have python3.4 in my mac. It can be called by the command --“python3”.  
When I use **Psychopy, even I run a simple experiment (like display “text” for 1s), it goes wrong.** The error message is:

> ######## Running: /Users/Duo/Desktop/new\_task\_WH\_CE/untitled\_lastrun.py ########  
> Traceback (most recent call last):  
> File “soundfile.pyc”, line 142, in   
> OSError: sndfile library not found  
> During handling of the above exception, another exception occurred:  
> Traceback (most recent call last):  
> File “/Users/Duo/Desktop/new\_task\_WH\_CE/untitled\_lastrun.py”, line 14, in   
> from psychopy import locale\_setup, sound, gui, visual, core, data, event, logging, clock  
> File “/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/psychopy/sound/ **init**.py”, line 79, in   
> from . import backend\_sounddevice as backend  
> File “/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/psychopy/sound/backend\_sounddevice.py”, line 20, in   
> import soundfile as sf  
> File “”, line 961, in \_find\_and\_load  
> File “”, line 950, in \_find\_and\_load\_unlocked  
> File “”, line 646, in \_load\_unlocked  
> File “”, line 616, in \_load\_backward\_compatible  
> File “soundfile.pyc”, line 156, in   
> File “posixpath.pyc”, line 78, in join  
> TypeError: expected str, bytes or os.PathLike object, not list

I went to check the files mentioned in the error messages. Then I found these code files declared **“#!/usr/bin/env python”** first. I guess it direct the python to the wrong version. In my case, it directs the python to the python2.7.  
If I redirect the python from python2.7 to python3.6 built in the psychopy, I think the psychopy will work normally.  
I tried to add the path of the python3.6 which is included in the psychopy as follow, but it didn’t work.

> /Applications/PsychoPy3.app/Contents/Resources/lib/python3.6

Could you help me to solve the problem? Thanks a lot.

---

<div class="post-metadata">

**Author:** ![Michael](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/michael/32/16_2.png) [@Michael](https://discourse.psychopy.org/u/Michael)\
**Post date:** [September 13, 2018, 7:05am UTC](https://discourse.psychopy.org/t/psychopy-cant-run-on-mac-due-to-versions-conflict/5314/2 "2018-09-13T07:05:00Z")

</div>

This isn’t anything to do with there being other versions of Python installed. The standalone version of PsychoPy is exactly that: it stands alone, and contains its own version of Python, which is what will be used when you push the green “run” button. Try this:

> [@Multiple users are having problems with libraries](https://discourse.psychopy.org/t/multiple-users-are-having-problems-with-libraries/5284/2):
>
> Sorry to hear that this caused a problem for a classroom (or at all!) There was a persistent and nasty packaging problem with one of the sound libraries (it kept looking like it was fixed but then broke again). I’m pretty confident it is now fixed in the 3.0.0b9 beta release so your students could try that or alternatively tell PsychoPy to use a different sound lib by changing the application preferences to this: ['pyo', u'sounddevice', u'pygame',] or even just ['pyo'] rather than: [u'so…

---

<div class="post-metadata">

**Author:** ![doreenduo43](https://avatars.discourse-cdn.com/v4/letter/d/b487fb/32.png) [@doreenduo43](https://discourse.psychopy.org/u/doreenduo43)\
**Post date:** [September 13, 2018, 7:52am UTC](https://discourse.psychopy.org/t/psychopy-cant-run-on-mac-due-to-versions-conflict/5314/3 "2018-09-13T07:52:10Z")

</div>

I truly appreciate your help!  
I changed it to [‘pyo’, u’sounddevice’, u’pygame’,], it can work now!
