2017-08-15 86 views
1

Python 2.7.10在win32上。 Windows 8.1中python 2.7無法導入地理編碼器庫

使用PIP安裝地址解析器庫https://pypi.python.org/pypi/geocoder/1.8.0

當我試圖得到這個錯誤,並導入

>>> import geocoder 
Traceback (most recent call last): 
    File "<interactive input>", line 1, in <module> 
    File "C:\Python27\ArcGIS10.4\lib\site-packages\geocoder\__init__.py", line 36, in <module> 
    from geocoder.api import get, yahoo, bing, geonames, mapquest, google, mapbox # noqa 
    File "C:\Python27\ArcGIS10.4\lib\site-packages\geocoder\api.py", line 29, in <module> 
    from geocoder.freegeoip import FreeGeoIP 
    File "C:\Python27\ArcGIS10.4\lib\site-packages\geocoder\freegeoip.py", line 6, in <module> 
    import ratelim 
    File "C:\Python27\ArcGIS10.4\lib\site-packages\ratelim\__init__.py", line 6, in <module> 
    from decorator import decorator 
ImportError: No module named decorator 
>>> 

我認爲圖書館只是一個安裝裝飾庫將修復situtation但庫已安裝

C:\Python27\ArcGIS10.4\Scripts>pip install decorator 
Requirement already satisfied: decorator in c:\python27\arcgis10.4\lib\site-packages 

更新

C:\Users\rizagha>python --version 
Python 2.7.10 

C:\Users\rizagha>python 
Python 2.7.10 (default, May 23 2015, 09:44:00) [MSC v.1500 64 bit (AMD64)] on win32 
Type "help", "copyright", "credits" or "license" for more information. 
>>> from decorator import decorator 
Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
ImportError: No module named decorator 

的東西,可能複雜化,這是我有蟒蛇32位和64位由ArcGIS安裝...

+0

可用,如果是2.7,然後進入Python解釋器,並嘗試手動輸入裝飾器輸入裝飾器 – AK47

+0

嗯所以檢查我的編輯,該模塊沒有導入.. – ziggy

回答

0

嘗試運行以下命令來安裝模塊

[[email protected]] python -m pip install decorator 

這應該將模塊安裝到運行python命令時啓動的解釋器的python庫

然後嘗試再次啓動解釋器並嘗試導入模塊NG它並沒有說這是已經滿足)

[[email protected]] python 
>> from decorator import decorator 
>> 

如果它說,它已經滿足,那麼你可以嘗試使用PIP卸載它,然後通過顯式指定蟒蛇-m命令

重新安裝
[[email protected]] pip uninstall decorator 
[[email protected]] python -m pip install decorator 

那麼你可以查看是否模塊處於默認的解釋器

[[email protected]] python 
>> from decorator import decorator 
>> 
在命令行鍵入python --version
+0

nope沒有工作,說要求已經滿足裝飾器,但是當我導入模塊它說它不存在 – ziggy

+1

嘗試做一個點卸載(沒有明確鍵入python -m),然後嘗試使用python -m pip install decorator重新安裝它 – AK47

+1

awesome that worked!重寫你的答案,所以我可以除了它! – ziggy