oTree Forum >

Need to update requirements to include more Python packages

#1 by noob_forever

Dear Chris, 

I've built an experiment that relies heavily on

"
import numpy as np
from scipy.stats import skewnorm     

...
"

Please add these (numpy and skewnorm from scipy.stats or just scipy.stats) to my requirements? 


Also, will we ever be able to do this ourselves or is there a good reason why we shouldn't have this ability? Is including these as requirements a bad practice?

#2 by Fanist

Hi there, 

Have you checked the requirements.txt in your project folder? It has the following lines:

# oTree-may-overwrite-this-file
# IF YOU MODIFY THIS FILE, remove this comment.
# otherwise, oTree will automatically overwrite it.
otree>=5.0.0a21
psycopg2>=2.8.4

If you wanna numpy and scipy.stats, you should do:
1. remove all comment lines
2. add lib name and versions

Hope this helps!

#3 by noob_forever

I only know how to use oTree Studio. Is this possible via studio? Sorry, I am still quite inexperienced.

#4 by Fanist

Not sure whether Studio can do it directly, but you can download your code and modify it locally.

Steps can be:
1. Studio-Download-Download .otreezip file
2. unzip it into a folder and modify it
3. install otree locally and run otree zip 
4. upload to deploy server again

#5 by noob_forever

!!! This is super helpful! Thanks so much. I got it fixed.

#6 by Chris_oTree

I have added numpy & scipy to your requirements.

Write a reply

Set forum username