HazyResearch / deepdive

DeepDive
deepdive.stanford.edu
1.96k stars 537 forks source link

ddlib fails for python3 #404

Closed raphaelhoffmann closed 8 years ago

raphaelhoffmann commented 9 years ago

Running a TSV extractor using python3 throws the following error:

22:38:04 [Helpers$(akka://deepdive)] INFO  Traceback (most recent call last):
22:38:04 [Helpers$(akka://deepdive)] INFO    File "/opt/elementary-memex-ddlog/escort-review/udf/extract_test.py", line 12, in <module>
22:38:04 [Helpers$(akka://deepdive)] INFO      import ddlib
22:38:04 [Helpers$(akka://deepdive)] INFO    File "/home/eve/local/lib/python/ddlib/__init__.py", line 1, in <module>
22:38:04 [Helpers$(akka://deepdive)] INFO      from dd import *
22:38:04 [Helpers$(akka://deepdive)] INFO  ImportError: No module named 'dd'

However, if I open $HOME/local/lib/python/ddlib/__init__.py and change

from dd import *
from gen_feats import *

to

from .dd import *
from .gen_feats import *

and also make a similar change in gen_feats.py, then everything works.

netj commented 8 years ago

@ThomasPalomares @juhanaka @ajratner can you create a PR if making ddlib play nice with Python3 is this simple? Thanks!

netj commented 8 years ago

Closed by #532