laptop and a wrench

Bug

An OSError occurs when instantiating a LayerFile object after changing the directory and not using the full path to the layer file (.lyrx) in ArcGIS Pro 3.0.

Zuletzt veröffentlicht: October 1, 2022 ArcGIS Pro
Bug-ID-Nummer BUG-000151539
EingereichtAugust 12, 2022
Zuletzt geändertFebruary 7, 2025
Gilt fürArcGIS Pro
Gefunden in Version3.0
BetriebssystemN/A
BetriebssystemversionN/A
StatusNon-Reproducible

Zusätzliche Informationen

This issue is non-reproducible. Use the following modified script to join the newly changed directory so the LYRX can be found correctly: import os import arcpy print(f'Currently in {os.getcwd()}\n') fldr_scratch = os.path.join(os.getcwd(), 'fldr_scratch') os.chdir(fldr_scratch) print(f'Now in {os.getcwd()}\n') layer = arcpy.mp.LayerFile(os.path.join(fldr_scratch, 'Boundary.lyrx')) print(layer.filePath)

Workaround

Use the full path to the layer file (.lyrx) as a string or by using the os.path.join() function.

Schritte zur Reproduzierung

Bug-ID: BUG-000151539

Software:

  • ArcGIS Pro

Benachrichtigung erhalten, wenn sich der Status eines Bugs ändert

Esri Support App herunterladen

Weitere Informationen zu diesem Thema erkunden

Unterstützung durch ArcGIS-Experten anfordern

An den technischen Support wenden

Esri Support App herunterladen

Zu Download-Optionen wechseln