# Adding external python modules

**URL:** <https://discourse.psychopy.org/t/adding-external-python-modules/17189>\
**Category:** Coding\
**Created:** [October 12, 2020, 7:43pm UTC](https://discourse.psychopy.org/t/adding-external-python-modules/17189 "2020-10-12T19:43:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![d.soto.b](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/d.soto.b/32/4177_2.png) [@d.soto.b](https://discourse.psychopy.org/u/d.soto.b)\
**Post date:** [October 12, 2020, 7:43pm UTC](https://discourse.psychopy.org/t/adding-external-python-modules/17189/1 "2020-10-12T19:43:11Z")

</div>

Hi there,

we need to install scikit-learn and other libraries as additional python modules, however I have tried in many different ways and cannot get it to work.

1. Download a copy of the package for Python 3.6 and adding the folder to the path of PsychoPy as suggested in the link below does not work  
[https://www.psychopy.org/recipes/addCustomModules.html](https://www.psychopy.org/recipes/addCustomModules.html)
2. Manually copying the library files it into the lib/ folder of the python standalone installation does not work
3. The option of using conda env create -n psychopy -f psychopy-env.yml does not work in the latest release of Psychopy (neither with Mojave nor with Catalina OSx), the application does not even launch on my mac.  
Using this I could easily add the python library within the conda environment
4. I have also tried previous versions of Psychopy using the developer tools, installing from source, but no luck.

Currently I can only run Psychopy using the standalone version but this is not sufficient for me,

are there any plans to make the conda env create -n psychopy -f psychopy-env.yml to work again on the mac platform?

I hope this is not much of a hassle and any help will be much appreciated!!

cheers  
david

---

<div class="post-metadata">

**Author:** ![jon](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/jon/32/22_2.png) [@jon](https://discourse.psychopy.org/u/jon)\
**Post date:** [October 15, 2020, 9:03am UTC](https://discourse.psychopy.org/t/adding-external-python-modules/17189/2 "2020-10-15T09:03:04Z")

</div>

1. Could you expand on “does not work”? Is there an error message that might inform us what’s wrong?
2. As above
3. When it does not launch, is there an error message?
4. … you get the idea. We can’t debug “it doesn’t work”

I personally use Framework python downloaded fom [Python.org](http://Python.org) and then I do `pip install psychopy` (make sure it’s the right python since you’ve obviously got several)

---

<div class="post-metadata">

**Author:** ![d.soto.b](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/d.soto.b/32/4177_2.png) [@d.soto.b](https://discourse.psychopy.org/u/d.soto.b)\
**Post date:** [October 15, 2020, 6:04pm UTC](https://discourse.psychopy.org/t/adding-external-python-modules/17189/3 "2020-10-15T18:04:38Z")

</div>

Thanks Jon for the response and sorry for not being more specific. I’ll comment here on the installation using the psychopy-env.yml, which is the most straighforward and one of the most recommended in the documentation. Six months ago it was working fine.  
I removed the env and reinstalled it a few weeks ago and it does not work anymore. Psychopy does not even launch. I activate the conda env and then hit psychopy in the terminal. It just gets stuck, no error or anything appears in the terminal.  
Can you help re: this?  
thanks!  
david

---

<div class="post-metadata">

**Author:** ![jon](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/jon/32/22_2.png) [@jon](https://discourse.psychopy.org/u/jon)\
**Post date:** [October 15, 2020, 7:03pm UTC](https://discourse.psychopy.org/t/adding-external-python-modules/17189/4 "2020-10-15T19:03:19Z")

</div>

Sorry, without a message that’s really not going to be easy to debug remotely

---

<div class="post-metadata">

**Author:** ![d.soto.b](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/d.soto.b/32/4177_2.png) [@d.soto.b](https://discourse.psychopy.org/u/d.soto.b)\
**Post date:** [October 15, 2020, 9:23pm UTC](https://discourse.psychopy.org/t/adding-external-python-modules/17189/5 "2020-10-15T21:23:25Z")

</div>

Hi Jon, OK I have now opened the Console in my mac and checked for any message popping just when I enter psychopy in the Terminal. As I said the terminal shows nothing  
but I could see that the Console systematically gives this message

default 23:12:30.914288 +0200 taskgated MacOS error: -67062

and I have also noticed that the same error comes up after I activate the conda environmente with conda activate psychopy

I did not find any information on what this error may mean

hope this is somehow useful!! as I said it happened in latest release but not in the past from march april

thanks for your help!

david

---

<div class="post-metadata">

**Author:** ![d.soto.b](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/d.soto.b/32/4177_2.png) [@d.soto.b](https://discourse.psychopy.org/u/d.soto.b)\
**Post date:** [October 26, 2020, 10:30am UTC](https://discourse.psychopy.org/t/adding-external-python-modules/17189/6 "2020-10-26T10:30:26Z")

</div>

Hi Jon, sorry to chase on this.

I’ve tried again the installation with the latest Psychopy release using the psychopy-env.yml and still gives this default 23:12:30.914288 +0200 taskgated MacOS error: -67062 I can see from the Console

Then I decided to give pip a try. I am using Catalina, I created a conda env with python 3.6 and then did pip. When I launch Psychopy I get this error message…Is there anything that could be done to solve this?

thanks for your time!

best  
david

File “/Users/david\_soto/miniconda3/envs/psychopy/bin/psychopy”, line 8, in   
sys.exit(main())  
File “/Users/david\_soto/miniconda3/envs/psychopy/lib/python3.6/site-packages/psychopy/app/psychopyApp.py”, line 93, in main  
stderr=True)  
File “/Users/david\_soto/miniconda3/envs/psychopy/lib/python3.6/site-packages/psychopy/core.py”, line 153, in shellCall  
encoding=encoding, env=env)  
File “/Users/david\_soto/miniconda3/envs/psychopy/lib/python3.6/subprocess.py”, line 729, in **init**  
restore\_signals, start\_new\_session)  
File “/Users/david\_soto/miniconda3/envs/psychopy/lib/python3.6/subprocess.py”, line 1364, in \_execute\_child  
raise child\_exception\_type(errno\_num, err\_msg, err\_filename)  
FileNotFoundError: [Errno 2] No such file or directory: ‘/Users/david\_soto/miniconda3/envs/psychopy/bin/pythonw’: ‘/Users/david\_soto/miniconda3/envs/psychopy/bin/pythonw’
