locked
TIP: Installing Python libraries on DSVM by Non Administrators RRS feed

  • General discussion

  • This was a question one of the internal user of DSVM within Microsoft brought up. 

    If you are not an admin (or do not have write access to c:\Anaconda on Windows or /anaconda on Linux DSVM), then you will not be able to conda install or pip install new Python packages.

    Here is a workaround if you cannot buy yourself admin access on the DSVM and need to install some customer Python packages. The idea is that you create your own conda environment in a path prefix where you have access. 

    conda create python=3.5 anaconda -p <Directory that you have Write access>

    Now you can activate the environment by typing

    activate <Full Directory Path from above>

    Now you should be able to conda or pip install packages. This will install in the currently activated environment. This will keep global environment intact.  It also means that you will need to keep it updated  (if you want the latest) by running in your activated environment:

    conda update conda
    conda update anaconda
    conda update [List of packages]

    Are there any other methods/workarounds others have used in these situations?





    Thursday, March 30, 2017 8:22 PM

All replies


  • It looks like Python has a simpler solution to address this and have user specific library to augment the global library i.e. continue to use the global library for global packages and still have a local set of libraries only individual users get to see.

    The key is the environment variable called “PYTHONUSERBASE” and set it to your local  directory where the user’s private libraries are stored. Once you do this you can just do a:

    pip install –user mylib

    This will install in PYTHONUSERBASE. “pip list” will show the global and user specific libraries. I think this is a perfect solution for DVM shared environments.

    Another cool thing, you can have just the individual user try out a latter version of the package without impacting other user.s

    For eg: If I wanted to try the latest pyodbc without affecting other users I can run:

    pip install –upgrade –user pyodbc

    Only I will see the latest pyodbc. All other users will see the global (older) version. 

    Friday, May 12, 2017 6:31 PM