Solved! Go to Solution.
OK, thanks. The issue is that the PYTHONPATH variable is set. PYTHONPATH is tricky, because it is used in the initialization of Python and will preempt other settings on the machine. We fixed a bug for ignoring PYTHONPATH in Pro 2.3, but unsetting this variable should be enough to fix your machine. You can find the environment variables by pressing Win+Break > Advanced System Settings > Environment variables and removing PYTHONPATH entries from the user and system variable panes if it exists. This page on modifying environment variables may be helpful: https://www.computerhope.com/issues/ch000549.htm
Once you've unset that, you can check that its correct by closing and reopening. You'll have to fully close e.g. a Python Command Prompt session for these to be flushed, but if it works, your Pro should work again and you shouldn't see any 10.6 references when checking sys.path.
I used spyder for both arcmap (when I had it installed) and ArcGIS pro for some time.
I just wrote scripts as if they were python 3 scripts and paid attention to those tools that differed in their parameters when I needed to have a script run in both map and pro. I found no glitches in using pro's arcpy in both scenarios.
Are you running into particular problems?
Thank you for your response, good to know. Let me reframe. I though it was a Python problem, but perhaps it isn't. Pro throws this error when I try to use Raster Calculator (from within Pro):
I thought this must have to do with the Anaconda Python 2.7 32-bit distribution I have installed conflicting with Pro, which needs Python 3 64-bit. However, shouldn't Pro be calling its own version of Python, regardless? Even if it weren't, wouldn't the immediate problem have to do with the version, not the bit type? To check all this, I have run this same process (raster calculator on the same file) on my secondary computer, which has the same program setup (Desktop, Pro, Anaconda), and there are no problems on that machine. I tried reinstalling Pro and Anaconda, and the problem persists. Any ideas?
Python for arcmap and hence arcpy is usually installed in a c:\pythonx.x folder
Python for Pro is installed in C:\your_installation_path\bin\Python\envs\arcgispro-py3
arcpy is installed in C:\your_installation_path\Resources
I would check to see which version you launch. I do all my scripting in Pro using spyder as well.
If you want to work with both version of python in spyder, have a look. I only use pro, so I can't confirm
The simplest would be to pip install spyder in your 2.7 distribution so that you are sure you are using the correct version for both.
This wasn't using scripting at all - it was just using the GUI in Pro. I believe I have an idea how to get scripting to work for both python versions, but before I do that I'd like to get Pro back to working as a stand alone program.
I don't use the python thing in Pro since it isn't clear what it is running
I would hate to recommend doing a ….
Control Panel, Add/Remove programs, 'Repair' ...
'Repair' might fix the ArcGIS Pro problem, but it may undo something that you now have working
Sam, are you still suffering from this issue? Do you have a custom environment you're working with, or just the default arcgispro-py3 environment? There are numerous places that Python can be injected into the environment that aren't entirely obvious (system variables, registry keys, cross-linked .pth files) so debugging can be tricky. Can you reproduce this from a command line session of Pro via the Python Command Prompt session? I can give you some starting points before you jump on with support.
Hi Shaun - I have yet to resolve the issue. I did take Curtis Price's suggestion to investigate the syspath, and found that there are two 10.6 paths that have snuck into the Pro environment somehow (see pic below). My best guess is that the problem really has nothing to do with python, and everything to do with Pro trying to access 10.6's 32-bit materials. However, I don't know how this happened or how to reconfigure the paths (I have opened an Esri support ticket, no luck yet). My latest attempt was to uninstall 10.6 completely and then repair Pro, but those paths remain. Any suggestions?