How can I prevent the permission denied error when I run "pip install" in a workspace?

andrea.loweandrea.lowe Member, Moderator, Domino Posts: 27 mod

If you are attempting to install or upgrade packages using "pip install" in a workspace, then you may receive a permission denied error. 

For example: 

!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 a workspace session, but you need to include the --user flag to avoid the permissions error.

For example:

!pip install --upgrade --user scikit-learn

However, this installation will not persist from run to run. If you consistently need this library upgrade, you can install this in a custom environment by following the instructions here.

Sign In or Register to comment.