It's trying to create a cache directory. You can tell it to do this somewhere else with the THEANO_FLAGS variable (as we do for the test suite - https://sources.debian.org/src/theano/0.9.0+dfsg-2/debian/rules/#L34 ).