When attempting to install or upgrade packages using "pip install", you receive a permission denied error.
!pip install --upgrade scikit-learn
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/scikit-learn'
It's possible to install/upgrade packages in an interactive session, but you need to include the --user flag to avoid the permissions error.
!pip install --upgrade --user scikit-learn
However, this installation will not persist from run to run. If you consistently need this library upgrade, you have a couple of options:
- You can add scikit-learn==0.18.1 to your project's requirements.txt file, as outlined here: http://support.dominodatalab.com/hc/en-us/articles/204842945-How-can-I-install-packages-or-dependencies-#python . This will install it automatically at the start of every run.
- However, you may find that scikit-learn in particular is slow to install. So you may want to take advantage of compute environment caching: http://support.dominodatalab.com/hc/en-us/articles/213226403-How-Do-I-Cache-an-Installation-