Hey all,
I'm trying to create a script and am stuck at a very SIMPLE step. In the code below the listMaps() function is returning an empty list so I'm getting an index out of range error. This project DOES have one map in it, any ideas why it's not "seeing" it? (All necessary packages are imported in the project).
When I print aprx I get: <arcpy._mp.ArcGISProject object at 0x0000021769973640>
When I delete the index [0] from m and print m it shows [ ] (empty list)
Thanks
```
def sdDraft(outdir, sde_path): ## Output directory (project_path in main).
project_name = os.path.join(outdir, 'Enterprise.aprx') ## Change as needed
service_name = 'CensusTest' ## Change as needed
sddraft_filename = service_name + '.sddraft'
sddraft_output_filename = os.path.join(outdir, sddraft_filename)
sd_filename = service_name + '.sd'
sd_output_filename = os.path.join(outdir, sd_filename)
# Layer(s) to publish
aprx = arcpy.mp.ArcGISProject(project_name)
m = aprx.listMaps('Enterprise')[0] ## Change as needed
print(m)
```