Anaconda Arcpy install

1646
4
07-07-2020 11:32 AM
JoeBorgione
MVP Esteemed Contributor

Dan Patterson‌:

I've seen you use the term "That's why I use anaconda..." and never really gave it much thought till now.  I have a miniconda environment I set up a few weeks back (Spyder 4.1.3 Short Cut  and Python Install ) as well as a clone of the ArcGIS Pro.  But now.....  I'd like to add arcpy to my miniconda env.  I don't need ArcGIS pro to recognize it, it's just so I can call arcpy if I need to when I'm doing other scripting in a Spyder 4.x window.

Is it really just as easy as adding another package to my miniconda env?  How does licensing work?

ps: Now, you will be responsible to clean up the mess when they want to have "arcpy"   I have a feeling I may get to understand this comment from you...

That should just about do it....
Tags (2)
0 Kudos
4 Replies
DanPatterson
MVP Esteemed Contributor

Oooooo (Border still closed... so I should be safe  )

C:\arc_pro\Resources\ArcPy is where arcpy resides, It is basically out of the 'conda' path of installable modules, hence, it doesn't list when you do 'conda list'.

Now the 'arcgis' module is installable and it provides checks during its import ( __init__.py files) as to whether arcpy exists, and if it resides on the same machine and is licensed to be used, it can be used.  Did you install 'arcgis' on the machine that has Pro installed?

I haven't had the need to explore setting up a separate miniconda and tried to see if I could get to be found.  I just use another machine, I find it cheaper and less frustrating)

Be safe


... sort of retired...
JoeBorgione
MVP Esteemed Contributor

Tried adding the package and it failed. Oh well...

(base) C:\>cd clones\miniconda3

(base) C:\Clones\Miniconda3>conda install -c esri arcpy
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: -
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed

UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:

Specifications:

  - arcpy -> python[version='>=3.6,<3.7.0a0']

Your python: python=3.7

If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.

The following specifications were found to be incompatible with your CUDA driver:

  - feature:/win-64::__cuda==10.1=0

Your installed CUDA driver is: 10.1



(base) C:\Clones\Miniconda3>
That should just about do it....
0 Kudos
DanPatterson
MVP Esteemed Contributor

Oh yeah... you can't use python 3.7.  arcgisscripting is compiled against 3.6.10.  I already inquired about this on Beta and was told 'not this time'.  The good news is, 3.8 may be the default version by next year since 3.6, 3.7 and 3.8 are the python versions on Anaconda.  By next year, 3.6 will roll off and 3.9 will be added


... sort of retired...
JoeBorgione
MVP Esteemed Contributor

I already inquired about this on Beta and was told 'not this time'.  Isn't every release beta?!

I'm gonna leave everything as is; with the arcgis pro clone and the miniconda envs, I'm bouncing back and forth between the two spyders. One spyder I have as a white background the other is black so I know where I am.  The sql scripts I'm working with eventually go from csv to fgdb table, so I was just hoping to keep them all rolled up together.  

That should just about do it....
0 Kudos