Arcpro 2.6.2 arcpy without conda

558
3
10-05-2020 11:56 AM
JasonBeaver
New Contributor

Is there any capability to run arcpro arcpy without working in a conda environment? In ArcGIS 10.7 it is as quick as creating a .pth file with the required paths to arcpy, bin and the toolbox scripts though recreating this file for pro returns the error: 

arcpy must be run from inside the Conda environment, which ArcGIS
uses to manage the installation of Python.
You can access this environment by launching Python from the links inside the
"ArcGIS > ArcGIS Pro" Start Menu Group:
"Python Interactive Terminal" starts a Python session.
"Python Command Prompt" opens a Command Prompt window initialized with Conda.

Or by running the proenv.bat file in the terminal:
C:\> C:\Program Files\ArcGIS\Pro\bin\python\scripts\proenv.bat

File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\__init__.py", line 70, in <module> raise ImportError("arcpy needs to run within an active ArcGIS Conda environment") ImportError: arcpy needs to run within an active ArcGIS Conda environment

All I have managed to find on this topic was the question here from two years prior saying that a feature to use external conda installs did not make it with Arcpro 2.1

Tags (3)
0 Kudos
3 Replies
DanPatterson
MVP Esteemed Contributor

What python IDE do you use?

I have had no problem using arcpy from within Spyder, Pythonwin, Jupyter console, Jupyter Notebook, Jupyterlab, Spyder notebooks, Notepad++ plus a few others whose names escape me at the moment.

All that means is that to use arcpy, you have to use a python version supported by arcpy and that you can set up a python environment/IDE to use it.


... sort of retired...
0 Kudos
JasonBeaver
New Contributor

I am working within Notepad++ with Python 3.8.6

0 Kudos
DanPatterson
MVP Esteemed Contributor

arcpy isn't going to work with 3.8.*, it is tied to python 3.6. (currently 3.6.12 security release) for the time being

Timeline for python upgrade? 

Sadly it is a couple of releases behind so do your non-arcpy stuff separately from your arcpy work.  Multiple versions of python cause "issues" which for many are finding hard to iron out.  Use the version of python that ships with Pro and use the conda that comes with it.  The original parallel processing... side-by-side machines


... sort of retired...
0 Kudos