簡體   English   中英

如何讓 python 運行我的代碼的當前版本? 不是 git 問題

[英]How do I make python run the current version of my code? Not a git problem

我不斷收到下面列出的錯誤。 問題不在於有錯誤。 這是拋出錯誤的代碼段不再存在。 我對其進行了修改以解決錯誤。 它現在調用方法 .coordnates() 而不是屬性 .extent,但它似乎以某種方式繼續運行舊代碼(以粗體顯示)。 我嘗試換掉我的 IDE 並重新啟動機器,但仍然沒有。 它目前沒有在回購中跟蹤。 所以我沒有想法。 這是一台Windows 10機器。

Traceback (most recent call last):

  File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\PGE_Pro_Py3\lib\site-packages\arcgis\geometry\_types.py", line 183, in __getattr__
    return self.__getitem__(name)
  File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\PGE_Pro_Py3\lib\site-packages\arcgis\geometry\_types.py", line 190, in __getitem__
    return dict.__getitem__(self, k)
KeyError: 'extent'
 
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File \\rcnas01-smb\NRM_DataTeam\e_Scripts\~DS\Defensible_space_pre_inspection_form_export_2022_20211029.py, line 192, in <module>
    map_server_response = temp.site_map(item_webmap, 'Asset Centroid', "ASSET_NAME = '{}'".format(which_one))
  File \\rcnas01-smb\NRM_DataTeam\e_Scripts\template_fxn.py, line 154, in site_map
    **extent = sdf_zoomer.spatial.bbox.buffer(400).extent**
  File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\PGE_Pro_Py3\lib\site-packages\arcgis\geometry\_types.py", line 186, in __getattr__

    "'%s' object has no attribute '%s'" % (type(self).__name__, name)

AttributeError: 'Geometry' object has no attribute 'extent'

感謝大家的回復。 我弄清楚了這個問題。 導入函數庫的舊副本如何保存在另一個目錄中,該目錄也附加在其中。程序首先用舊文件引用第一個附加路徑。 因此,當我更新腳本時,程序繼續使用舊副本。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM