5

I used Eclipse with PyDev to create a script in Python (windows 7 x64). My code runs perfect when I start the run in Eclipse, but when I add it as a Tool in ArcGIS 10.1, I have the following problems:

If I select ‘run python script in progress’ (which I know I shouldn’t do): enter image description here

If I don’t select ‘run python script in progress’, there are two possibilities:

1) Eclipse is closed when I start the run: ArcGIS automatically opens Eclipse, and the script seems to run, but doesn’t do anything, this windows stays open until I cancel the run: enter image description here

2) If eclipse is opened before I start the run, it seems as if the run is completed within 0.00 seconds, but the script was not executed...: enter image description here

My configuration in eclipse is as follows (anaconda python + paths for functionalities arcgis): enter image description here

I run the tool in ArcGIS without any parameters, so the code is exactly the same as the code that I run from Eclipse... I already tried this solution, but it doesn’t seem to work for me:

3
  • The problem is likely that you are mixing the Python from python.org (in C:\Python27) and the Anaconda Python (in C:\Anaconda). Commented Jan 22, 2015 at 23:06
  • Thank you for the reaction, any idea how I could avoid mixing the two versions? I tried this but it doesn't seem to work... Commented Feb 5, 2015 at 15:58
  • @Mattias Are you using the 32 bit or 64 bit version of Anaconda Python? Commented May 15, 2015 at 15:53

1 Answer 1

1

You can move the ArcPy directory into the Anaconda folder. Make sure you are using the 32-bit version of Anaconda before you do this.

Go into the root folder for the ArcGIS python:

C:\Python27\ArcGIS10.4\Lib\site-packages

then look for a file named Desktop 10.4.pth If you are using a different version of Arc it will read 10.x instead of 10.4 which is what I am currently using.

You want to copy that file. MAKE SURE YOU COPY IT. If that file leaves where it is located you will have issues. Paste the copied file into the site-packages folder for anaconda:

C:\Users\(CurrentProfile)\AppData\Local\Continuum\Anaconda2 (or Anaconda if using version1)\Lib\site-packages

Once pasted in there restart Anaconda and you should be all set up.

ArMoraer
5,7493 gold badges27 silver badges52 bronze badges
answered Jun 27, 2016 at 13:12

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.