somnathrakshit / geograpy3

Extract place names from a URL or text, and add context to those names -- for example distinguishing between a country, region or city.

Home Page:https://geograpy3.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] ModuleNotFoundError: No module named 'lodstorage'

honzajavorek opened this issue · comments

Describe the bug

When trying to use geograpy, I'm getting the following error:

.../geograpy/wikidata.py:7: in <module>
    from lodstorage.sparql import SPARQL
E   ModuleNotFoundError: No module named 'lodstorage'

To Reproduce

  1. pipenv install geograpy3
  2. NLTK_DATA=./nltk_data/ geograpy-nltk
  3. In my Python program:
from pathlib import Path

import nltk
nltk.data.path.append(Path(__file__).parent.parent.parent.parent / 'nltk_data')
import geograpy  # here it blows up with ModuleNotFoundError

print(geograpy.get_geoPlace_context(text='Prague'))

Expected behavior

I'm changing path to the NLTK data, but I don't think that's related. It blows up on not being able to find a module lodstorage, which indeed I can't see anywhere in the package nor in the requirements. Where does it come from? What is it?

Environment (please complete the following information):

  • OS: macOS Mojave
  • Python Version: 3.7.5

I also had this effect recently and created a new release specifically to fix this problem. Which version have you tried and did you do a pip-upgrade or force the version?

I installed it just today. Lockfile says I have ==0.1.18

What does pip show say?

$ pip show geograpy3
Name: geograpy3
Version: 0.1.18
Summary: Extract countries, regions and cities from a URL or text
Home-page: https://github.com/somnathrakshit/geograpy3
Author: Somnath Rakshit
Author-email: --censored--@gmail.com
License: Apache
Location: /--censored--/virtualenvs/--censored--/lib/python3.7/site-packages
Requires: jellyfish, newspaper3k, numpy, nltk, pycountry
Required-by:

so there we have it the requirement for https://pypi.org/project/pylodstorage/ is missing.

if the CI works I'll create a release in a minute

That was fast! 😄 I'm just installing the package to verify if having it there fixes the issue.

Thx for giving us a star. I love https://github.com/somnathrakshit/geograpy3/actions - which makes "release early/release often" possible thanks to @somnathrakshit ' work on this.

If you have any examples for http://wiki.bitplan.com/index.php/Geograpy#Examples based on your usecase I'd love to here about them.