ww-tech / lookml-tools

Tools to handle best practices for LookML dev. Contains three tools: LookML updater, linter, and grapher
Apache License 2.0
85 stars 16 forks source link

module 'lkmltools' has no attribute 'grapher' #6

Closed zhenliu2012 closed 4 years ago

zhenliu2012 commented 5 years ago

Hi,

I am getting error message: AttributeError: module 'lkmltools' has no attribute 'grapher' by running lkmltools.grapher.lookml_grapher as described on your Documentation.

It looks like the module doesn't have grapher method.

weightwatchers-carlanderson commented 4 years ago

Hi @zhenliu2012 How are you running this?

This file runs OK:

$$ more test_grapher.py
from lkmltools.grapher.lookml_grapher import LookMlGrapher
LookMlGrapher({})
print("done!")
$$ python test_grapher.py
done!

as well as running this

$$ python run_grapher.py --config config/grapher/config_grapher.json
2019-09-26 16:00:39,572 INFO lookml_grapher.py extract_graph_info: Processing test/grapher_lkml/some_model.model.lkml
2019-09-26 16:00:39,574 INFO lookml_grapher.py extract_graph_info: Processing test/grapher_lkml/orphan_view.view.lkml
2019-09-26 16:00:39,575 INFO lookml_grapher.py extract_graph_info: Processing test/grapher_lkml/some_view.view.lkml
2019-09-26 16:00:39,576 INFO lookml_grapher.py extract_graph_info: Processing test/grapher_lkml/some_explore.explore.lkml
2019-09-26 16:00:39,577 INFO lookml_grapher.py extract_graph_info: Processing test/grapher_lkml/some_other_view.view.lkml
2019-09-26 16:00:39,578 INFO lookml_grapher.py run: Setting the following options: {'g': <networkx.classes.digraph.DiGraph object at 0x127407fd0>, 'filename': 'graph.png', 'title': 'test/grapher_lkml/*.lkml as of 2019-09-26', 'node_size': 500, 'label_font_size': 18, 'text_angle': 30, 'image_width': 24, 'image_height': 16}
2019-09-26 16:00:40,375 INFO lookml_grapher.py plot_graph: Graph written to graph.png
zhenliu2012 commented 4 years ago

Hi @weightwatchers-carlanderson , I installed this package using pip: pip install lookml-tools then I opened up my jupyter notebook instance and tried to import grapher: from lkmltools.grapher.lookml_grapher import LookMlGrapher but it threw me that error msg.

ModuleNotFoundError: No module named 'lkmltools.grapher'

My workaround for this was to copy this repo lkmltools to my working directory and run it in command line: python path_to_grapher/run_grapher.py --config config_grapher_project_name.json

weightwatchers-carlanderson commented 4 years ago

@zhenliu2012 OK, thanks for the info. I will test this out.

zhenliu2012 commented 4 years ago

Thanks!

On Thu, Sep 26, 2019 at 5:12 PM carl anderson notifications@github.com wrote:

@zhenliu2012 https://github.com/zhenliu2012 OK, thanks for the info. I will test this out.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ww-tech/lookml-tools/issues/6?email_source=notifications&email_token=AITV6NA3IVIXZNQA4A7L6U3QLUQS7A5CNFSM4IXHHMAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7W7HIA#issuecomment-535688096, or mute the thread https://github.com/notifications/unsubscribe-auth/AITV6NFV5USWGQV4W4LRTC3QLUQS7ANCNFSM4IXHHMAA .

weightwatchers-carlanderson commented 4 years ago

@zhenliu2012 this issue is now fixed in 2.0.3. The code was not packaged up correctly for distribution in pypi.

Screen Shot 2019-09-28 at 2 40 27 PM