swanny0819 / python-gedcom-2

Python module for parsing, analyzing, and manipulating GEDCOM files
GNU General Public License v2.0
3 stars 2 forks source link

ModuleNotFoundError: No module named 'gedcom' #8

Open philiprhoades opened 11 months ago

philiprhoades commented 11 months ago

@swanny0819 ,

I have installed the module I think:

$ pip list | grep gedcom
python-gedcom-2           1.7.0

and I am trying to run this:

https://github.com/blokhin/genealogical-trees/blob/master/gedcom2ttl.py

ie

gedcom2ttl.py tsars.ged

but I get:

Traceback (most recent call last):
  File "/home/phr/src/github/genealogical-trees/data/../gedcom2ttl.py", line 11, in <module>
    from gedcom import Gedcom
ModuleNotFoundError: No module named 'gedcom'

I'm not a Python person obviously - what am I missing?

Thanks, Phil.

swanny0819 commented 11 months ago

I think I see what's causing the problem you're running into.

Instead of from gedcom import Gedcom on line 11, you want from python_gedcom_2.parser import Parser.

Then later when you're invoking Gedcom to parse your file on line 20, you'll want to replace that line with

parser = Parser()
parser.parse_file(workpath)