Select to view content in your preferred language

ModuleNotFoundError: No module named 'arcpy'

3449
7
Jump to solution
11-20-2017 03:48 AM
RebeccaRicker
Emerging Contributor

Hey People,

I have got some troubles. I use Spyder and ArcGIS-Pro to run Python scripts. It already worked, but suddenly it doesn't anymore. Maybe I changed the settings with out knowing. I don't know.

Could someone tell me please which settings I have to do?

I have those settings in ArcGIS-Pro:


But I don't know, which settings I have to do in Spyder:

And when I try to run the script. Spyder asks me for settings. I think this is new:

Thanks for Help!

0 Kudos
1 Solution

Accepted Solutions
DanPatterson_Retired
MVP Emeritus

Only install Spyder from the ArcGIS Pro distribution and not from Anaconda separately..  See the blog post I wrote and linked earlier.  I suspect that you have several instances of spyder and/or python loaded.. including the one from ArcMap.  I would uninstall the 2.x.x version (that is old) and uninstall the one from within ArcGIS Pro.  If that doesn't work, completely uninstall Pro, and ensure that all links to in are gone, then reinstall Pro, and reinstall spyder from within Pro.  Cehck my blog for associating scripts with spyder so you can edit them when working with spyder.

Create a shortcut on your desktop (see another of my blogs listed) so you can work with Pro's Anaconda distribution of python and Spyder

Good luck

View solution in original post

7 Replies
DanPatterson_Retired
MVP Emeritus

It look fine... see this blog post for the default installation location....

As for running Spyder, when you say it doesn't work...

Are you launching it from within the anaconda distribution?

Are you editing a toolbox script from within Pro?

From a desktop shortcut?..... see this link

Try not to double-click on a *.py or any other shortcut ... you can get them to work, but old school ...launch program, open file... is the best way

more details needed I suppose if none of the above cover your case.

RebeccaRicker
Emerging Contributor

Thanks for your answer.

 - I installed Spyder 2.3.8 Packages in ArcGIS Pro and made the Settings like above

- Than I installed the Spyder 2.3.8 Package in Anaconda

- Than I Launched Spyder from anaconda and wrote my script.

- Than I wanted I wanted to run it. It worked before but suddenly it didn't anymore. So I reinstall Spyder in ArcGIS and Anaconda. Still broken   

0 Kudos
RebeccaRicker
Emerging Contributor

... I don't know, but It works again. I removed Spyder from Anaconda and started it by putting this "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Scripts\spyder.exe" in my task bar. I noticed that it opens Spyder 2, while Anaconda opens Spyder 3. I tried to deinstall Spyder completely from my PC, but it is not shown in my Control Panel. I am afraid I broke something.

Do you know, what I did wrong at the first place. It unsettles me a lot!  

0 Kudos
RebeccaRicker
Emerging Contributor

Oky... still does not work:

0 Kudos
DanPatterson_Retired
MVP Emeritus

Only install Spyder from the ArcGIS Pro distribution and not from Anaconda separately..  See the blog post I wrote and linked earlier.  I suspect that you have several instances of spyder and/or python loaded.. including the one from ArcMap.  I would uninstall the 2.x.x version (that is old) and uninstall the one from within ArcGIS Pro.  If that doesn't work, completely uninstall Pro, and ensure that all links to in are gone, then reinstall Pro, and reinstall spyder from within Pro.  Cehck my blog for associating scripts with spyder so you can edit them when working with spyder.

Create a shortcut on your desktop (see another of my blogs listed) so you can work with Pro's Anaconda distribution of python and Spyder

Good luck

DanPatterson_Retired
MVP Emeritus

PS... install IPython from with ArcGIS Pro's distribution as well, IF spyder doesn't do it for you in the dependencies list (can't remember now)

0 Kudos
RebeccaRicker
Emerging Contributor

Thank you for your help. I had to refresh my whole computer... 😕

But It's working now  So thanks!

0 Kudos