简体   繁体   English

如何让 python 运行我的代码的当前版本? 不是 git 问题

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

I keep getting the error listed below.我不断收到下面列出的错误。 The problem isn't that there's an error.问题不在于有错误。 It's that the segment of code that is throwing the error no longer exists.这是抛出错误的代码段不再存在。 I modified it to address the error.我对其进行了修改以解决错误。 It now calls a method .cooridnates() rather than the propery .extent, but it seems to keep running the old code some how (shown in bold).它现在调用方法 .coordnates() 而不是属性 .extent,但它似乎以某种方式继续运行旧代码(以粗体显示)。 I tried swapping out my IDE and restarting the machine, but still nothing.我尝试换掉我的 IDE 并重新启动机器,但仍然没有。 It's not currently tracked in a repo.它目前没有在回购中跟踪。 So I'm out of ideas.所以我没有想法。 It's a windows 10 machine.这是一台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'

Thanks everyone for the replies.感谢大家的回复。 I figured out the issue.我弄清楚了这个问题。 Some how an old copy of the imported function library was saved in another directory that was also appended in. The program refenerced the first appended path with the old file first.导入函数库的旧副本如何保存在另一个目录中,该目录也附加在其中。程序首先用旧文件引用第一个附加路径。 So as I update the script the program continue to used the old copy.因此,当我更新脚本时,程序继续使用旧副本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM