Python 3.6 tries to initialize with Python 2.7

2790
24
Jump to solution
04-03-2019 12:17 PM
MarkBinder
Occasional Contributor

I am having some major Python issues. When I try to start PyCharm using the ArcGIS Pro Python environment it tries to initialize using the Python 2.7 ArcGIS 10.6 installation. Somehow my Python installations got crossed up.

I've tried uninstalling ArcGIS Pro and reinstalling it but that has no effect.

Is there any way to solve this?

0 Kudos
24 Replies
MarkBinder
Occasional Contributor

It looks like my computer is having some issues with the python path. I seem to have some crossover between python versions. This is included in the python path and sys.path for my python 2.7 32 bit installation:

Those paths are also included included in the python 3.6 installation; along with some python 2.7 paths:

Is there any way to make changes to these paths so that they load correctly?

0 Kudos
DanPatterson_Retired
MVP Emeritus

did you install the version of python for background geoprocessing as well?

looks like that is also an issue if you have 32 and 64 bit python 2.7 fighting it out with 64 bit python 3.6

Background Geoprocessing (64-bit)—Help | ArcGIS for Desktop 

0 Kudos
MarkBinder
Occasional Contributor

It was installed but is not now. I checked my home computer where I have ArcGIS Desktop 10.7, background geoprocessing, and ArcGIS Pro 2.3 installed and there is no python path crossover.

0 Kudos
MarkBinder
Occasional Contributor

So I think I found the solution. In Spyder I went to 'Tools/Current user environment variables...' and cleared out the values in PYTHONPATH. That has stopped adding all of those unrelated paths and only loads the paths for each installation of Python.

0 Kudos
curtvprice
MVP Esteemed Contributor

Yes, like I said above, PYTHONPATH if set by some other installer will mess things up.

0 Kudos