laptop and a wrench

Erro

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.

Última Publicação: October 1, 2022 ArcGIS Pro
Número de ID do Erro BUG-000151539
EnviadoAugust 12, 2022
Última ModificaçãoFebruary 7, 2025
Aplica-se àArcGIS Pro
Versão encontrada3.0
Sistema OperacionalN/A
Versão do Sistema OperacionalN/A
StatusNon-Reproducible

Informações Adicionais

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)

Solução Provisória

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

Etapas para Reproduzir

ID do Erro: BUG-000151539

Software:

  • ArcGIS Pro

Seja notificado quando o status de um erro mudar

Baixe o Aplicativo de Suporte da Esri

Descubra mais sobre este tema

Obtenha ajuda de especialistas do ArcGIS

Entre em contato com Suporte Técnico

Baixe o Aplicativo de Suporte da Esri

Ir para as opções de download