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

Unable to run grapher #1

Closed ernestoongaro closed 5 years ago

ernestoongaro commented 5 years ago

Installed via brew install node ; npm install -g lookml-parser and the error is python run_grapher.py --config grapher_config.json Traceback (most recent call last): File "run_grapher.py", line 10, in <module> from lkmltools.grapher.lookml_grapher import LookMlGrapher ImportError: No module named grapher.lookml_grapher

weightwatchers-carlanderson commented 5 years ago

@ernestoongaro I don't understand. It must be something to do with your Python path:

nycCANDERSONmbp:lookml-tools carl.anderson$ python -m venv env

nycCANDERSONmbp:lookml-tools carl.anderson$ 
nycCANDERSONmbp:lookml-tools carl.anderson$ source env/bin/activate
(env) nycCANDERSONmbp:lookml-tools carl.anderson$ pip install lookml-tools
Collecting lookml-tools
  Downloading https://files.pythonhosted.org/packages/e5/68/18d5116a9863f0124dec1701eccc8795ba30ea090f62f42bfc8d0b1027c9/lookml_tools-1.0.0-py3-none-any.whl
Installing collected packages: lookml-tools
Successfully installed lookml-tools-1.0.0
You are using pip version 9.0.1, however version 19.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(env) nycCANDERSONmbp:lookml-tools carl.anderson$ brew install node
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 3 taps (homebrew/core, homebrew/cask and caskroom/cask).
==> New Formulae
drone-cli                                      scala@2.12                                     swig@3
==> Updated Formulae
openssl ✔              cfn-lint               glooctl                lgogdownloader         minio-mc               scons
sphinx-doc ✔           cgal                   gmic                   libbitcoin             mkvtoolnix             scrcpy
ammonite-repl          chakra                 gnuradio               libbitcoin-blockchain  monero                 serverless
angular-cli            circleci               go                     libbitcoin-client      mpich                  sfcgal
anyenv                 citus                  godep                  libbitcoin-database    ncmpcpp                ship
aravis                 cocoapods              goofys                 libbitcoin-explorer    node-build             sops
armadillo              cointop                goreleaser             libbitcoin-network     nomad                  source-highlight
atlantis               composer               grakn                  libbitcoin-node        opa                    telegraf
avro-cpp               cpprestsdk             graph-tool             libbitcoin-protocol    openimageio            terraform
aws-sdk-cpp            cucumber-cpp           gst-plugins-good       libbitcoin-server      osquery                terragrunt
azure-storage-cpp      deno                   helmfile               libev                  osrm-backend           tokei
bitcoin                dependency-check       hlint                  libpulsar              paket                  tomcat
bitrise                doctl                  i2pd                   librealsense           pandoc                 topgrade
boost                  encfs                  icecream               libsigc++              pgrouting              uhd
boost-bcp              envconsul              imagemagick            libswiften             phpmyadmin             upscaledb
boost-build            exiftool               imagemagick@6          libtorrent-rasterbar   phpunit                vultr
boost-mpi              firebase-cli           jdupes                 lmod                   presto                 webpack
boost-python           flow                   jenkins                lxc                    procs                  wesnoth
boost-python3          fluxctl                jenkins-lts            macvim                 pulumi                 whois
braid                  folly                  jfrog-cli-go           mame                   pybind11               widelands
buildifier             futhark                jhipster               mesa                   pyenv                  wildfly-as
caffe                  gibo                   joplin                 metaproxy              rbspy                  wtf
calicoctl              glib                   knot                   mighttpd2              scala                  yelp-tools
certbot                glib-networking        ledger                 minio                  scalariform            you-get
==> Deleted Formulae
scala@2.10                                                             swig@3.04

Error: node 12.1.0 is already installed
To upgrade to 12.4.0, run `brew upgrade node`.
==> `brew cleanup` has not been run in 30 days, running now...
Removing: /Users/carl.anderson/Library/Caches/Homebrew/fontconfig--2.13.1.high_sierra.bottle.tar.gz... (1.2MB)
Removing: /Users/carl.anderson/Library/Caches/Homebrew/gd--2.2.5.high_sierra.bottle.tar.gz... (290.2KB)
Removing: /Users/carl.anderson/Library/Caches/Homebrew/jpeg--9c.high_sierra.bottle.tar.gz... (297.6KB)
Removing: /Users/carl.anderson/Library/Caches/Homebrew/libtiff--4.0.10.high_sierra.bottle.tar.gz... (1MB)
Removing: /Users/carl.anderson/Library/Caches/Homebrew/libtool--2.4.6_1.high_sierra.bottle.tar.gz... (1009.5KB)
Removing: /Users/carl.anderson/Library/Caches/Homebrew/node--12.1.0.high_sierra.bottle.tar.gz... (14.4MB)
Removing: /Users/carl.anderson/Library/Caches/Homebrew/openssl--1.0.2r.high_sierra.bottle.tar.gz... (3.7MB)
Removing: /Users/carl.anderson/Library/Caches/Homebrew/sphinx-doc--2.1.0.high_sierra.bottle.tar.gz... (14.7MB)
Removing: /Users/carl.anderson/Library/Logs/Homebrew/postgresql... (1.2KB)
Removing: /Users/carl.anderson/Library/Logs/Homebrew/ncurses... (64B)
Removing: /Users/carl.anderson/Library/Logs/Homebrew/zsh-completions... (111B)
Removing: /Users/carl.anderson/Library/Logs/Homebrew/readline... (64B)
Removing: /Users/carl.anderson/Library/Logs/Homebrew/pcre... (64B)
Removing: /Users/carl.anderson/Library/Logs/Homebrew/zsh... (64B)
Removing: /Users/carl.anderson/Library/Logs/Homebrew/zsh-syntax-highlighting... (64B)
Removing: /Users/carl.anderson/Library/Logs/Homebrew/openssl... (64B)
Removing: /Users/carl.anderson/Library/Logs/Homebrew/telnet... (64B)
Pruned 1 symbolic links from /usr/local
(env) nycCANDERSONmbp:lookml-tools carl.anderson$ npm install -g lookml-parser
/usr/local/bin/lookml-parser -> /usr/local/lib/node_modules/lookml-parser/cli.js
+ lookml-parser@3.4.0
updated 3 packages in 1.195s
(env) nycCANDERSONmbp:lookml-tools carl.anderson$ python run_grapher.py --config config/grapher/config_grapher.json 
2019-06-14 13:04:57,758 INFO lookml_grapher.py process_file: Processing ../cie-looker/fact_membership.view.lkml
2019-06-14 13:04:57,759 INFO lookml.py parse_repo: running /usr/local/bin/lookml-parser --input='../cie-looker/fact_membership.view.lkml' --whitespace=2 > parsed_lookml.json
2019-06-14 13:04:57,932 INFO lookml_grapher.py process_file: Processing ../cie-looker/dim_meeting.view.lkml
2019-06-14 13:04:57,933 INFO lookml.py parse_repo: running /usr/local/bin/lookml-parser --input='../cie-looker/dim_meeting.view.lkml' --whitespace=2 > parsed_lookml.json
2019-06-14 13:04:58,094 INFO lookml_grapher.py process_file: Processing ../cie-looker/dim_geography.view.lkml
2019-06-14 13:04:58,095 INFO lookml.py parse_repo: running /usr/local/bin/lookml-parser --input='../cie-looker/dim_geography.view.lkml' --whitespace=2 > parsed_lookml.json
2019-06-14 13:04:58,248 INFO lookml_grapher.py process_file: Processing ../cie-looker/dim_location.view.lkml
2019-06-14 13:04:58,249 INFO lookml.py parse_repo: running /usr/local/bin/lookml-parser --input='../cie-looker/dim_location.view.lkml' --whitespace=2 > parsed_lookml.json
2019-06-14 13:04:58,409 INFO lookml_grapher.py process_file: Processing ../cie-looker/dim_product.view.lkml
2019-06-14 13:04:58,410 INFO lookml.py parse_repo: running /usr/local/bin/lookml-parser --input='../cie-looker/dim_product.view.lkml' --whitespace=2 > parsed_lookml.json
2019-06-14 13:04:58,573 INFO lookml_grapher.py process_file: Processing ../cie-looker/orphan.view.lkml
2019-06-14 13:04:58,574 INFO lookml.py parse_repo: running /usr/local/bin/lookml-parser --input='../cie-looker/orphan.view.lkml' --whitespace=2 > parsed_lookml.json
2019-06-14 13:04:58,740 INFO lookml_grapher.py process_file: Processing ../cie-looker/dq_oracle_events.view.lkml
2019-06-14 13:04:58,740 INFO lookml.py parse_repo: running /usr/local/bin/lookml-parser --input='../cie-looker/dq_oracle_events.view.lkml' --whitespace=2 > parsed_lookml.json
2019-06-14 13:04:58,912 INFO lookml_grapher.py process_file: Processing ../cie-looker/fact_rewards.view.lkml
2019-06-14 13:04:58,913 INFO lookml.py parse_repo: running /usr/local/bin/lookml-parser --input='../cie-looker/fact_rewards.view.lkml' --whitespace=2 > parsed_lookml.json
2019-06-14 13:04:59,074 INFO lookml_grapher.py process_file: Processing ../cie-looker/membership_facts.model.lkml
2019-06-14 13:04:59,074 INFO lookml.py parse_repo: running /usr/local/bin/lookml-parser --input='../cie-looker/membership_facts.model.lkml' --whitespace=2 > parsed_lookml.json
2019-06-14 13:04:59,252 INFO lookml_grapher.py process_file: Processing ../cie-looker/dim_time.view.lkml
2019-06-14 13:04:59,253 INFO lookml.py parse_repo: running /usr/local/bin/lookml-parser --input='../cie-looker/dim_time.view.lkml' --whitespace=2 > parsed_lookml.json
2019-06-14 13:04:59,414 INFO lookml_grapher.py process_file: Processing ../cie-looker/data_quality_dashboard.model.lkml
2019-06-14 13:04:59,415 INFO lookml.py parse_repo: running /usr/local/bin/lookml-parser --input='../cie-looker/data_quality_dashboard.model.lkml' --whitespace=2 > parsed_lookml.json
2019-06-14 13:04:59,575 INFO lookml_grapher.py process_file: Processing ../cie-looker/dim_member.view.lkml
2019-06-14 13:04:59,576 INFO lookml.py parse_repo: running /usr/local/bin/lookml-parser --input='../cie-looker/dim_member.view.lkml' --whitespace=2 > parsed_lookml.json
2019-06-14 13:04:59,743 INFO lookml_grapher.py process_file: Processing ../cie-looker/dim_date.view.lkml
2019-06-14 13:04:59,743 INFO lookml.py parse_repo: running /usr/local/bin/lookml-parser --input='../cie-looker/dim_date.view.lkml' --whitespace=2 > parsed_lookml.json
2019-06-14 13:04:59,916 INFO lookml_grapher.py process_file: Processing ../cie-looker/fact_engagement.view.lkml
2019-06-14 13:04:59,917 INFO lookml.py parse_repo: running /usr/local/bin/lookml-parser --input='../cie-looker/fact_engagement.view.lkml' --whitespace=2 > parsed_lookml.json
2019-06-14 13:05:00,078 INFO lookml_grapher.py process_file: Processing ../cie-looker/fact_attendance.view.lkml
2019-06-14 13:05:00,079 INFO lookml.py parse_repo: running /usr/local/bin/lookml-parser --input='../cie-looker/fact_attendance.view.lkml' --whitespace=2 > parsed_lookml.json
2019-06-14 13:05:00,241 INFO lookml_grapher.py process_file: Processing ../cie-looker/fact_survey.view.lkml
2019-06-14 13:05:00,241 INFO lookml.py parse_repo: running /usr/local/bin/lookml-parser --input='../cie-looker/fact_survey.view.lkml' --whitespace=2 > parsed_lookml.json
2019-06-14 13:05:00,406 INFO lookml_grapher.py process_file: Processing ../cie-looker/conformed_dimensions.model.lkml
2019-06-14 13:05:00,406 INFO lookml.py parse_repo: running /usr/local/bin/lookml-parser --input='../cie-looker/conformed_dimensions.model.lkml' --whitespace=2 > parsed_lookml.json
2019-06-14 13:05:01,605 INFO lookml_grapher.py plot_graph: Graph written to graph.png
(env) nycCANDERSONmbp:lookml-tools carl.anderson$ 
ernestoongaro commented 5 years ago

Hmmm - what version of Python do you expect? My Mac OS ships with 2.7

ernestoongaro commented 5 years ago

image https://xkcd.com/1987/

weightwatchers-carlanderson commented 5 years ago

@ernestoongaro this is 3.6 code and is not compatible with 2.7. You can most easily install 3.6 with anaconda (https://www.datacamp.com/community/tutorials/installing-anaconda-mac-os-x)

The version is listed in the Dockerfile but I'll update setup.py to make the version clearer

weightwatchers-carlanderson commented 5 years ago

closing as can't reproduce (wrong Python version being used by user)