0

所以我在我正在使用的模块中发现了一个错误(哪个不重要,但如果你必须知道它是geopy.distance

所以我知道我必须做什么来修复代码,但是当我打开 .py 文件并对其进行编辑时,它就好像它没有被编辑一样!

这是编辑前的错误回溯:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/2.7/site-packages/geopy-0.95.1-py2.7.egg/geopy/distance.py", line 37, in __init__
    kilometers += self.measure(a, b)
  File "/Library/Python/2.7/site-packages/geopy-0.95.1-py2.7.egg/geopy/distance.py", line 72, in measure
    raise NotImplementedError
NotImplementedError

这是我编辑文件后的错误回溯:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/2.7/site-packages/geopy-0.95.1-py2.7.egg/geopy/distance.py", line 37, in __init__
    kilometers += self.measure(a, b)
  File "/Library/Python/2.7/site-packages/geopy-0.95.1-py2.7.egg/geopy/distance.py", line 72, in measure
    a, b = Point(a), Point(b)
NotImplementedError

如您所见,我将其更改为不会raise NotImplementedError,但它仍在提高它!这怎么可能?

4

1 回答 1

1

看起来您已经编辑了一个.py文件,但用户进程没有覆盖该.pyc文件的权限。根据文件,它NotImplementedError仍在第 72 行.pyc,但它显示文件中的当前第 72.py

旁白:看起来像是Distance一个抽象类。您不应该直接实例化,而是它的子类之一。例如GreatCircleDistanceVincentyDistance

还要注意文件中的最后两行

# Set the default distance formula to the most generally accurate.
distance = VincentyDistance
于 2013-05-13T01:38:39.250 回答