Module 'arcpy' has no 'ImportCredentials' member

240
2
Jump to solution
05-15-2020 10:27 AM
JonathanBailey_LimGeomatics
Occasional Contributor

I'm writing a Python script that will require access to non-token-based ArcGIS Server services. Looking at the ArcPy documentation, the approach is to use ImportCredentials.

In its simplest form, here's my Python script:

import arcpy
arcpy.ImportCredentials(my_ags_file)‍‍

Attempting to lint or run this code in Visual Studio Code results in the error:

Module 'arcpy' has no 'ImportCredentials' member‍‍

What am I doing wrong?

Using ArcGIS Pro 2.5.1 and ArcGIS Server 10.8.1

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
JonathanBailey_LimGeomatics
Occasional Contributor

Hi Dan,

Thanks for your reply. Turns out I was just referencing the wrong Python environment.

View solution in original post

0 Kudos
2 Replies
DanPatterson
MVP Esteemed Contributor

reportedly 'fixed' but you seem to have a higher server version than indicated in these posts.

Try the salient lines in the python window in Pro or in a Jupyter Notebook in Pro to rule out a VS code issue

BUG-000114121: ArcGIS GIS Server 10.5x and ArcGIS GIS Server 10.6 p.. 

https://community.esri.com/thread/231916-arcgis-server-attributeerror-module-arcpy-has-no-attribute-... 


... sort of retired...
0 Kudos
JonathanBailey_LimGeomatics
Occasional Contributor

Hi Dan,

Thanks for your reply. Turns out I was just referencing the wrong Python environment.

0 Kudos