You will need to add: import dill as pickle INTO: /usr/local/lib/python3.6/dist-packages/hyperopt/fmin.py At the very top.