The getcwd() Python method returns the incorrect current working directory of a process when the project is launched from the Start menu.
最後に公開された状態: February 23, 2023ArcGIS Pro
不具合 ID 番号
BUG-000154997
送信されました
January 10, 2023
最終更新日
October 7, 2024
適用対象
ArcGIS Pro
見つかったバージョン
3.0.3
オペレーティング システム
N/A
オペレーティング システムのバージョン
N/A
ステータス
As Designed
開発チームによる確認後に、この動作が設計どおりであると判断されました。 詳細については、「参考情報」セクションをご参照ください。
参考情報
When an application is launched either from the start menu or from the cmd.exe session, there is a well-established 'current directory' behavior. Python simply returns whatever the application's current directory is with os.getcwd().
iPython notebooks do not provide a way to determine the current running .ipynb, refer to the discussion at https://github.com/ipython/ipython/issues/10123
If the intent is to query the current ArcGIS Pro in which the Python code is running, use the 'arcpy.mp.ArcGISProject("CURRENT").homeFolde' command.