Select to view content in your preferred language

Code completion not working in Spyder 5.1.5 after upgrade to ArcPro 3.0

9216
4
Jump to solution
06-24-2022 07:08 AM
DuncanHornby
MVP Notable Contributor

All,

Hoping to get advice on resolving issue with new spyder IDE in new ArcPro 3.0...

So I have upgraded to ArcPro 3.0, looks great and loads of new functionality. I cloned the default environment using the new ArcPro Package Manager and in my new cloned environment I installed the 5.1.5 spyder IDE.

The IDE runs and insisted I installed something called Kite, which I allowed. My first line in the Editor (not console) was import arcpy, My second line was arcpy.Add... but no autocomplete appeared. It seems to be broken and I'm hoping someone from ESRI could advise?

I checked preferences, all looks OK.

DuncanHornby_0-1656079386719.png

Importantly this never stops spinning...

DuncanHornby_1-1656079444353.png

A quick search on the internet and some sites suggest right clicking on it and choosing restart, I did this the word changes from starting to restarting and the icon keeps spinning forever and no change in auto-completion.

In the console, auto-completion works.

So basically I use Spyder because its the supported IDE that ArcPro distributes through package manager but I can't now write any code as the auto-completion does not work... 😞

I can also replicate this problem on a second independent machine.

0 Kudos
2 Solutions

Accepted Solutions
DanPatterson
MVP Esteemed Contributor

Don't bother trying to fix it.  I haven't been able to track down the dependency that is at issue. It is related to the python-language-server

I think it is one of those >= dependencies  which should have been a >-= and <

I filed an issue on their github site and they couldn't narrow it down.

Install 5.3.x was the suggestion, however Anaconda is brutally slow in updating packages and Spyder is one of them/.

Don't use conda-forge either, it is worse.

Besides, you type fast and don't make mistakes? don't you?  😉


... sort of retired...

View solution in original post

0 Kudos
DuncanHornby
MVP Notable Contributor

OK for anyone facing the same problem, Dan's suggestion of upgrading Spyder seems to have worked, nice one Dan! A virtual beer is coming through your letterbox.

ArcPro 3.0 does not allow you to upgrade spyder to 5.3.1, it's simply not an option, so this is what I did:

  • Opened a command line window in admin mode
  • Changed directory to my cloned environment for me it was:

 

 

 

cd C:\Users\hornbydd\AppData\Local\ESRI\conda\envs\arcgispro-py3_spyder\Scripts

 

  • Upgraded Spyder with the following command:

 

pip install -U spyder

 

I let it update and opened Spyder and the autocomplete is now working as expected. I should say that to do all this ArcPro must be closed.

February 2023 update!

Esri's release of ArcPro 3.1.0 again destroyed my existing python environment. I had to remove this, then clone the default and activate the new environment. Despite ArcPro 3.1.0 being packaged with spyder 5.3.3 it refused to install it and I ended up back here on my own page seeking my own advice! I would add this nugget of information I tried my advice above and that failed so what I ended up doing was first installing spyder 5.1.1 using

 

pip install -U spyder==5.1.1

 

 That seem to install, I then upgraded it to 5.3.3 using:

 

pip install -U spyder==5.3.3

 

This incremental upgrade approach from the MSDOS command line window seems to be the only way I can get spyder installed.

View solution in original post

4 Replies
DanPatterson
MVP Esteemed Contributor

Don't bother trying to fix it.  I haven't been able to track down the dependency that is at issue. It is related to the python-language-server

I think it is one of those >= dependencies  which should have been a >-= and <

I filed an issue on their github site and they couldn't narrow it down.

Install 5.3.x was the suggestion, however Anaconda is brutally slow in updating packages and Spyder is one of them/.

Don't use conda-forge either, it is worse.

Besides, you type fast and don't make mistakes? don't you?  😉


... sort of retired...
0 Kudos
DuncanHornby
MVP Notable Contributor

OK for anyone facing the same problem, Dan's suggestion of upgrading Spyder seems to have worked, nice one Dan! A virtual beer is coming through your letterbox.

ArcPro 3.0 does not allow you to upgrade spyder to 5.3.1, it's simply not an option, so this is what I did:

  • Opened a command line window in admin mode
  • Changed directory to my cloned environment for me it was:

 

 

 

cd C:\Users\hornbydd\AppData\Local\ESRI\conda\envs\arcgispro-py3_spyder\Scripts

 

  • Upgraded Spyder with the following command:

 

pip install -U spyder

 

I let it update and opened Spyder and the autocomplete is now working as expected. I should say that to do all this ArcPro must be closed.

February 2023 update!

Esri's release of ArcPro 3.1.0 again destroyed my existing python environment. I had to remove this, then clone the default and activate the new environment. Despite ArcPro 3.1.0 being packaged with spyder 5.3.3 it refused to install it and I ended up back here on my own page seeking my own advice! I would add this nugget of information I tried my advice above and that failed so what I ended up doing was first installing spyder 5.1.1 using

 

pip install -U spyder==5.1.1

 

 That seem to install, I then upgraded it to 5.3.3 using:

 

pip install -U spyder==5.3.3

 

This incremental upgrade approach from the MSDOS command line window seems to be the only way I can get spyder installed.

ChrisRingo
Regular Contributor

Just a couple comments/questions, a few months removed from the date of your post. First - thanks for posting your process. Every new rev of Arc brings new challenges getting our python IDEs working again, and it's great to have some help, speaking as someone barely conversant in development environments 🙂

First a question - Have you tried opening a Jupyter Notebook after installing Spyder? I had Spyder working fine in Pro 3.0.2, but had not been able to get both Spyder and Jupyter Notebooks working at the same time. Jupyter works fine in the default environment (and outside of Pro), but not in the cloned environment after installing Spyder. So I went back to Pro 3.0.0 (after deleting the entire contents of my conda folder) to try your method of installing Spyder, but unfortunately no change with Jupyter.  

Secondly just an FYI, for posterity - when I went through installing Spyder in 3.0.0 using the steps you outlined above, there is a minor difference now that it's several months layer. pip now installs Spyder version 5.4.0 rather than 5.3.1, and when starting Spyder I got a missing dependency error, telling me I needed nbconvert >=4.0, which was missing. I tried "pip install -U nbconvert", and that did the trick.

 

 

DanPatterson
MVP Esteemed Contributor

There are issues with dependencies that I have brought up with the arcgis team that relate to the desire to support older widgets.  The real problem started when arcgis became installed by default and the dependency conflict arose.  In that circumstance, pip install spyder installs what is needed, but not what arcgis notebooks needs.  This doesn't affect non-map notebooks outside arcgis, however.

So create your environments carefully when you clone.  On that note, one can change what gets cloned to a new environment (but enough said).  I suspect that the issue with the particular dependency will be resolved with arcgis 2.1 since having to choose between a python IDE and an in-Pro notebook shouldn't be a choice.

Now if only arcpy/arcgisscripting would work with python 10


... sort of retired...