0

Python 2.6で実行しようとしているコードは次のとおりです

from pygeocoder import Geocoder
results = Geocoder.geocode("Ireland")
print(results[0].coordinates)

Windowsマシンにリンク( http://code.xster.net/pygeocoder/wiki/Home )からpygeocoderをインストールしました。

実行しようとするとエラーが発生します:

C:\work>TestGeoCode.py
Traceback (most recent call last):
File "C:\work\TestGeoCode.py", line 2, in <module>
results = Geocoder.geocode("Ireland")
File "c:\python26\lib\site-packages\pygeocoder-1.2.1-py2.6.egg\pygeocoder.py",
line 160, in geocode
return GeocoderResult(Geocoder.get_data(params=params))
TypeError: Can't instantiate abstract class GeocoderResult with abstract methods
__next__

私のubuntuマシンでは正常に動作しています。

このエラーが発生する理由を教えてください。

ありがとうアビシェーク

4

1 に答える 1

0

試してみてくださいGeocoder.geocode("[Town], [Country]")

于 2013-07-23T12:28:47.450 に答える