Arcpy (ArcGIS Pro 2.2) Intellisense not working in Visual Studio 2017

1685
10
09-21-2018 12:05 PM
ManishShrivastav
New Contributor III

Hi all geeks,

I am trying to use Visual Studio 2017 (15.8.5) as an IDE for python (arcpy from arcgis pro 2.2). I have cloned the python environment and configured it in Visual Studio. When I try to write code after importing arcpy module, the intellisense doesn't show up and I can't autocomplete the code. I am attaching the screenshot.

0 Kudos
10 Replies
JakeSimms1
New Contributor III

Greetings Manish! What version of Visual Studio 2017 are you using. Microsoft documentation states : 

  • In Visual Studio 2017 version 15.5 and earlier, IntelliSense completions depend on a database that's been compiled for that library. Building the database is done in the background when a library is installed, but can take some time and may not be complete when you start writing code.
  • In Visual Studio 2017 version 15.6 and later uses a faster method to provide completions that do not depend on the database by default. For this reason the tab is labeled IntelliSense [database disabled]. You can enable the database by clearing the option Tools > Options > Python > Experimental > Use new style IntelliSense for environments.

https://docs.microsoft.com/en-us/visualstudio/python/python-environments-window-tab-reference?view=v...

You may want to look into updating your packages. This also is explained in the link above. 

ManishShrivastav
New Contributor III

Jake I am using Visual Studio Pro 2017, the solution you suggested is for VS Code I guess. Thanks for your time though.

0 Kudos
JakeSimms1
New Contributor III

Manish, please review my reply to your original post.

0 Kudos
JakeSimms1
New Contributor III

In Visual Studio Pro 2017 go to Tools > Python > Python Environments (this opens the window) select the python 2.7 (64 or 32 bit) and check to see if you have red exclamation points. If you do click the Refresh DB (blue circle arrow). This should update your python database and allow you to use IntelliSense.

0 Kudos
ManishShrivastav
New Contributor III

Hi Jake,

I am using Visual Studio 15.8.6 now and have enabled Tools > Options > Python > Experimental > Use new style IntelliSense for environments.

0 Kudos
JakeSimms1
New Contributor III

Manish, please review my reply above your latest post.

0 Kudos
ManishShrivastav
New Contributor III

Jake I tried to refresh the DB earlier but it takes forever to refresh and never gets completed.

0 Kudos
JakeSimms1
New Contributor III

Manish, refreshing the database time frame depends on how many packages you have loaded in an environment. This may take time.

ManishShrivastav
New Contributor III

Hi Jake,

I have now update the visual studio to 15.9.4 and ArcGIS Pro 2.2.4 and cloned the python environment, but even now I am not able to get the arcpy intellisense to work in visual studio. I have enabled "Use new style intellisense for environments" option in visual studio Tools->Option->Python->Experimental. Help is greatly appreciated.

0 Kudos