Geohash是一个能够对地理位置信息进行加密和解密的系统,https://en.wikipedia.org/wiki/Geohash函数
Python安装geohash库后,可调用decode()
和encode()
函数。加密
按照通常的步骤进行安装pip install geohash
,在确认安装成功后,import Geohash
仍然报错: ImportError: No module named ‘geohash’
, 说找不到Geohash模块。翻译
百思不得其解。后面想到多是Python3和Python2有所不同,我用的是Python3。在网上找到一个解决方案:code
rename the package name to be geohash rather than Geohash and then change init.py to import from .geohash (with a dot in front of the module name) rather than from geohash, the package should work for Python 3.5.2.ip
翻译:get
将包名称重命名为geohash而不是Geohash,而后将init.py更改成从.geohash(在模块名称前面有一个点)而不是从geohash导入,该包应该适用于Python 3.5.2。hash
按照这个方法修改文件名称和 init.py 中的内容后,成功。it