Python3 installation Geohash

Source: Internet
Author: User

Geohash is a system that can encrypt and decrypt geo-location information, Https://en.wikipedia.org/wiki/Geohash

After Python installs the Geohash library, you can call the decode () and encode () functions. Follow the general steps to install (PIP install Geohash), after confirming the successful installation, import Geohash still error: Importerror:no module named ' Geohash ', said the Geohash module could not be found.

The solution is not to be baffled. Back to think of May be Python3 and Python2 something different, I use is Python3. Find a solution on the Web:

Rename the package name is Geohash rather than geohash and then change init.py to import from. Geohash (with a dot in F Ront of the module name) rather than from Geohash, the package should work for Python 3.5.2.

  The workaround is to go to the python37/lib/site-packages/directory and rename the Geohash folder to Geohash "uppercase Geohash to lowercase geohsah",

Then modify the __init__.py file under this directory to change from Geohash to from . Geohash"There's a dot in front of you."

After you modify the file name and the contents of the init. Py in this way, it succeeds.

>>> Import Geohash
>>> Geohash.encode (39.11111,12.22455,18)
' Sqbwqpvwsxm4uf8tdy '
>>>

Python3 installation Geohash

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.