AnsweredAssumed Answered

How to activate conda env from user directory?

Question asked by j.buchtaesri-de-esridist Employee on Apr 6, 2017
Latest reply on Apr 11, 2017 by j.buchtaesri-de-esridist

I'm using the conda environment that comes with ArcGIS Pro 1.4 (administrative install in C:\Program Files\ArcGIS\Pro).

 

So I open a cmd-shell and cd into C:\Program Files\ArcGIS\Pro\bin\Python\Scripts (running as normal Windows user, not as an administrative one).

Creating and listing a new conda env works just fine:

C:\Program Files\ArcGIS\Pro\bin\Python\Scripts>conda create --name JebuTest python=3.5
Fetching package metadata: ......
Solving package specifications: .........

Package plan for installation in environment C:\Users\jebu\.conda\envs\JebuTest:

The following NEW packages will be INSTALLED:

    pip:            9.0.1-py35_1
    python:         3.5.3-0
    setuptools:     27.2.0-py35_1
    vs2015_runtime: 14.0.25123-0
    wheel:          0.29.0-py35_0

Proceed ([y]/n)?

Linking packages ...
[      COMPLETE      ]|##################################################| 100%
#
# To activate this environment, use:
# > activate JebuTest
#

C:\Program Files\ArcGIS\Pro\bin\Python\Scripts>conda info --envs
# conda environments:
#
JebuTest                 C:\Users\jebu\.conda\envs\JebuTest
arcgispro-py3            C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3
root                  *  C:\Program Files\ArcGIS\Pro\bin\Python

As I'm not administrator, the environment installs into my user's home directory.

 

But if I try to activate the environment, it fails:

C:\Program Files\ArcGIS\Pro\bin\Python\Scripts>activate JebuTest
No environment named "JebuTest" exists in C:\Program Files\ArcGIS\Pro\bin\Python\envs, or is not a valid conda installation directory.

 

Conda info also knows about my user's home directory:

C:\Program Files\ArcGIS\Pro\bin\Python\Scripts>conda info
Current conda install:

             platform : win-64
        conda version : 4.0.11
  conda-build version : not installed
       python version : 3.5.2.final.0
     requests version : 2.11.1
     root environment : C:\Program Files\ArcGIS\Pro\bin\Python  (read only)
  default environment : C:\Program Files\ArcGIS\Pro\bin\Python
     envs directories : C:\Users\jebu\.conda\envs
                        C:\Users\jebu\envs
                        C:\Program Files\ArcGIS\Pro\bin\Python\envs
        package cache : C:\Users\jebu\.conda\envs\.pkgs
                        C:\Users\jebu\envs\.pkgs
                        C:\Program Files\ArcGIS\Pro\bin\Python\pkgs
         channel URLs : https://conda.anaconda.org/esri/win-64/
                        https://conda.anaconda.org/esri/noarch/
                        https://repo.continuum.io/pkgs/free/win-64/
                        https://repo.continuum.io/pkgs/free/noarch/
                        https://repo.continuum.io/pkgs/pro/win-64/
                        https://repo.continuum.io/pkgs/pro/noarch/
          config file : C:\Program Files\ArcGIS\Pro\bin\Python\.condarc
    is foreign system : False

 

I can workaround this, by manually setting CONDA_ENVS_PATH to my user's home directory, but that hides the default ArcGIS Pro environment..

 

Is this a bug in conda itself, a bug in ArcGIS Pro's installation of conda or just wrong usage?

 

Best Regards

Jens

Outcomes