I have a couple of python installations on my windows 7 machine. I have the one that was installed by ArcGIS, in a folder called "ArcGISx6410.2", and another I recently installed myself directly from the python website, I've put that in a folder called "DirectDownload".
The one installed by ArcGIS is the default one which I normally use, and which the windows path points too. This is what I get when I call python from the command prompt:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
U:\>python
Python 2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)] on win 32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.executable
'C:\\Python27\\ArcGISx6410.2\\python.exe'
But, ArcGIS itself appears to call the "DirectDownload" installation, and that one doesn't contain numpy, and can therefore not import arcpy. I don't need the "DirectDownload" installation any more, but if I remove it (or rename it) then ArcGIS will not load at all, it will not get past the splash screen.
How can I tell ArcGIS to use it's own installation of python, like it was doing quite happily until I installed the other version?
-
1This seems like a case when it's not worth the trouble trying to find out what's wrong and just reinstall ArcGIS.Martin– Martin2015年10月19日 10:26:31 +00:00Commented Oct 19, 2015 at 10:26
4 Answers 4
Try to use registry change-
Go to computer\HKEY_LOCAL_MACHINE\SOFTWARE\PYTHON\PythonCore2円.7\InstallPath
And change the path for DLL, Lib etc.
e.g.
My old setting was
C:\Python27\ArcGISx6410.3\Lib;C:\Python27\ArcGISx6410.3\DLLs;C:\Python27\ArcGISx6410.3\Lib\lib-tk
and my new setting is-
C:\Python27\ArcGIS10.3\Lib;C:\Python27\ArcGIS10.3\DLLs;C:\Python27\ArcGIS10.3\Lib\lib-tk
-
Have you got your solution!Learner– Learner2015年10月19日 10:29:57 +00:00Commented Oct 19, 2015 at 10:29
-
Thanks for the suggestion, but in Registry the install path for python is the ArcGIS one that I want already.EddyTheB– EddyTheB2015年10月19日 10:59:23 +00:00Commented Oct 19, 2015 at 10:59
-
Then locate where your shortcut of ide is located and change there like C:\Python27\ArcGISx6410.3\pythonw.exe "C:\Python27\ArcGISx6410.3\Lib\idlelib\idle.pyw" or C:\Python27\ArcGIS10.3\pythonw.exe "C:\Python27\ArcGIS10.3\Lib\idlelib\idle.pyw"Learner– Learner2015年10月19日 11:24:47 +00:00Commented Oct 19, 2015 at 11:24
Previous answers can certainly help in most cases and @Martins comment about reinstalling is true as well.
But in case that one doesn't want reinstall ArcGis (especially in development environments) since in some cases as long as you don't uninstall other python versions, there is a chance that the problem will insist.
After doing SIslam's steps, you can rename the folder of all other python installations temporarily (especially the same versions) and open arcmap and run a toolbox and arcmap will call the default python. this way you won't lose other versions of your python since you can rename them back.
You can change the default running python, from Environmental variables.
Go To My Computer> Properties> Advanced> Environment Variables
then select Path variable from User variables list and click edit, then change your Python folder from DirectDownload to the old folder you are interested in.
-
2Thanks for your suggestion, but unfortunately the only reference to python in the Path variable is already to the old one; "C:\Python27\ArcGISx6410.2\". It looks like it's only ArcGIS that points to the new installation.EddyTheB– EddyTheB2015年10月19日 10:22:14 +00:00Commented Oct 19, 2015 at 10:22
ArcMap defaults to C:\Users\dayl\AppData\Local\Continuum
after anaconda is installed.
Rename the Continuum fodler
C:\Users\dayl\AppData\Local\Continuum
to C:\Users\dayl\AppData\Local\Continuumx
Now import arcpy
should work.
Update your System Environment PATH
Since we renamed the Continuum folder we should update any paths that use it.
- Go to your System Properties
- Click the Advanced tab.
- Click Environment Variables.
In my case I had to update my conda path variable
Explore related questions
See similar questions with these tags.