Can't upgrade API to 1.4 - Conflict with Anaconda

725
13
Jump to solution
03-30-2018 10:55 AM
PhilLarkin1
Occasional Contributor III

I'm encountering an odd error when following the instructions for upgrading the package for Pro (2.1.2) located here: Install and set up | ArcGIS for Developers. I'm upgrading the Python API from 1.2.5


Using the Python Command Prompt packaged with the Pro installation leads to the error (see attachment): 'Package not found: 'arcgis' Package 'arcgis' is not installed in F:\Anaconda3\envs\arcgispro-py3 

There appears to be a conflict between my Anaconda installation and the conda installation packaged with ArcGIS Pro. It is odd that the Python Cmd Prompt doesn't recognize a package in the Pro environment because it is active. I tried adding a system and user path variable: "C:\Program Files\ArcGIS\Pro\bin\Python\Scripts". That didn't help. 

Has anyone experienced this and have any ideas? 

David Wynne

Joshua Bixby

0 Kudos
1 Solution

Accepted Solutions
PhilLarkin1
Occasional Contributor III

After uninstalling Anaconda I fully uninstalled Pro (deleting C:\Program Files\ArcGIS\Pro after uninstall). Installed Pro 2.1. Upgraded to 2.1.2.

I then successfully ran the upgrade conda upgrade command. Uninstalling everything was the solution. 

There were traceback errors on the conda upgrade. see attachment to the original post.

View solution in original post

0 Kudos
13 Replies
DanPatterson_Retired
MVP Esteemed Contributor

Did you try it through the Package Manager in Pro?

It did update via that route

PhilLarkin1
Occasional Contributor III

Hi Dan

Thanks for your reply. I didn't upgrade from 1.2.5 to 1.4 in Pro's Package Manager. The instructions explicitly state that the upgrade at Pro 2.1 should occur through the prompt prompt using the conda upgrade command. My problem is that the environment appears active from the syntax shown before the path <(arcgispro-py3)> but doesn't recognize any packages. 

This might come down to where activate.bat is finding the scripts_path. maybe the only scripts path available points to my Anaconda installation. I'm not sure how I would fix this. Here is the location in the bat file where this is referenced: @SET "CONDA_SCRIPTS=%scripts_path%"

0 Kudos
PhilLarkin1
Occasional Contributor III

When you run conda info from the active arcgispro-py3 env, what do you see? What is the root environment? 

condaInfo

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

Mine is different, perhaps the reason, but have a look

PhilLarkin1
Occasional Contributor III

Yes, I'd expect the root environemt to be C:\ArcGISPro\...

I need to figure out how to successfully activate Pro envs when I have Anaconda installed on the same machine. 

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

that is my root C:\ArcGISPro\...

The default root is for multi-user environments and is somewhere in the c:\programs-something locale

I do have python 3.6 installed hence some of the other packages are updated

0 Kudos
ShaunWalbridge
Esri Regular Contributor

Phil,

Could you open a command prompt, without having activated any conda environments, and paste the results of echo %PATH%? I suspect that your Anaconda installation is registered globally, and is masking the environment variables used by conda in the application. From the activated environment, could you also paste the output of set CON and where conda? Thanks!

0 Kudos
PhilLarkin1
Occasional Contributor III

Hi Shaun

Thanks for replying.

result from echo:

(i left out unrelated paths) 

C:\Program Files (x86)\ArcGIS\EsriProductionMapping\Desktop10.3\Bin;

F:\Anaconda3;

F:\Anaconda3\Scripts;

F:\Anaconda3\Library\bin;

C:\Program Files\ArcGIS\Pro\bin\Python\Scripts;

C:\Program Files\ArcGIS\Pro\bin\Python\Scripts;

set con:

(arcgispro-py3) C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3>set con
CONDA_DEFAULT_ENV=arcgispro-py3
CONDA_PREFIX=C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3
CONDA_PS1_BACKUP=$P$G

where conda:

(arcgispro-py3) C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3>where conda
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Scripts\conda
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Scripts\conda.bat
C:\Program Files\ArcGIS\Pro\bin\Python\Scripts\conda.exe
F:\Anaconda3\Scripts\conda.exe

0 Kudos
ShaunWalbridge
Esri Regular Contributor

OK, thanks. It isn't immediately clear to me why it is picking up the conda in your external Anaconda installation, since `where conda` lists the Pro provided one as a priority. But it clearly is, since all the information you posted from `conda info` is from the Anaconda environment, nothing matches what we ship. Could you try removing the Anaconda environment from your path? It is known to cause problems to have multiple Python environments on the PATH, here's what the Anaconda installation says:

The other option is, if you don't really care which conda executable you're using, is to specify the full path to the environment you want to modify. So, do something like:

activate "C:\Program Files\ArcGIS\bin\Python\envs\arcgispro-py3"
conda
upgrade -c esri --no-pin arcgis

It looks like you have two environments called "arcgispro-py3" -- the one that ships with Pro, and a second one located in F:\Anaconda\envs. That likely is confusing this arrangement, since the message may be perfectly valid (if there is no arcgis package in that separate "arcgispro-py3" environment).

Hope that helps, and happy to keep digging if this doesn't get you where you need to be.
Cheers, Shaun