Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Geohash Module installed but import error

I am using ipython Jupyter notebook in Windows 10. I have installed Geohash using pip install geohash in cmd. When I try to use geohash( import geohash) following error comes:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-7-840910eb012f> in <module>()
----> 1 import geohash

ImportError: No module named 'geohash'

Again check whether geohash installed or not then following message came while I try to reinstall:

C:\Users\Himal Acharya>pip install geohash
Requirement already satisfied (use --upgrade to upgrade): geohash in c:\users\himal acharya\anaconda3\lib\site-packages
Requirement already satisfied (use --upgrade to upgrade): docutils>=0.3 in c:\users\himal acharya\anaconda3\lib\site-packages (from geohash)

Again I uninstall geohash. I manually install geohash from github but same problem occur : import error

like image 228
Himal Acharya Avatar asked Apr 14 '16 17:04

Himal Acharya


3 Answers

pip install python-geohash

This should fix it.

like image 131
Jonathan Hilgart Avatar answered Oct 21 '22 12:10

Jonathan Hilgart


pip uninstall Geohash
pip install geohash2

it will install https://github.com/DBarthe/geohash version which is exactly the same as vinsci one but compliant with Python 3 import syntax (DBarthe did what @PoonLany explained in its answer)

like image 37
JR Utily Avatar answered Oct 21 '22 12:10

JR Utily


Found another way and it works like charm.

from gd-inm source: https://github.com/vinsci/geohash/issues/4

  1. rename the package name to be geohash rather than Geohash
  2. change init.py to import from .geohash (with a dot in front of the module name) rather than from geohash

I had the same issue - if you 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.

like image 5
PoonLamy Avatar answered Oct 21 '22 13:10

PoonLamy