scikit-hep / vegascope

View Vega/Vega-Lite plots in your web browser from local or remote Python processes.
BSD 3-Clause "New" or "Revised" License
35 stars 4 forks source link

Altair says VegaScope is not installed, but it is #8

Open jpivarski opened 4 years ago

jpivarski commented 4 years ago

Hi all,

It seems my issue is related to this but I cannot figure out how to fix it based on this thread. I have

Furthermore I can find the following specs : altair.VEGA_VERSION, same as altair.v4.VEGA_VERSION 5 altair.VEGAEMBED_VERSION, same as altair.v4.VEGAEMBED_VERSION 6 altair.VEGALITE_VERSION same as altair.v4.VEGALITE_VERSION 4.0.2.

With all these, when I try to type the following commands in iPython import altair; altair.renderers.enable('vegascope') I get the error : ValueError: To use the 'vegascope' renderer, you must install the vegascope package; see http://github.com/diana-hep/vegascope/ for more information.

Any idea how to solve this would be much appreciated. Thanks!

Originally posted by @aschoenauer-sebag in https://github.com/scikit-hep/vegascope/issues/5#issuecomment-595289853

jpivarski commented 4 years ago

This sounds like an issue with paths: Altair can't import vegascope, though you have installed it somewhere. In the same session where you can import altair, can you import vegascope?

Other relevant information includes:

Basically, Python installation questions.

aschoenauer-sebag commented 4 years ago

Thank you for your quick reply. I can indeed import vegascope and altair in the same iPython session. I used pip to install both packages.

Pretty standard sys.path ['/home/user/anaconda3/envs/pytorch/bin', '/home/user/anaconda3/envs/pytorch/lib/python37.zip', '/home/user/anaconda3/envs/pytorch/lib/python3.7', '/home/user/anaconda3/envs/pytorch/lib/python3.7/lib-dynload', '', '/home/user/.local/lib/python3.7/site-packages', '/home/user/anaconda3/envs/pytorch/lib/python3.7/site-packages', '/home/user/anaconda3/envs/pytorch/lib/python3.7/site-packages/IPython/extensions', '/home/user/.ipython']

In the Terminal, echo $PYTHONPATH: empty

jakevdp commented 4 years ago

I believe vegascope does not yet support the Altair v4 renderer entrypoint: https://github.com/scikit-hep/vegascope/blob/08cd5a3983cea8a057c7d17d548d463ba1ca4900/setup.py#L56

aschoenauer-sebag commented 4 years ago

Thank you. Does this mean there is nothing to do? Or is there anything I could change to fix that? Anything maybe with the altair.VEGALITE_VERSION or altair.v4.VEGALITE_VERSION vars?

jpivarski commented 4 years ago

Looking this up on altair-viz/altair#1939, it appears that altair_viewer is a viable alternative.

I developed VegaScope for a different project that has since changed direction, so I'm only supporting VegaScope as a service to the community. Altair developers don't have control over it (although forking it or taking it over would have been an option) and have started altair_viewer instead.

@jakevdp Actually, if altair_viewer reproduces all of the functionality of VegaScope, then I could archive this with a link to altair_viewer, recommending that.

jakevdp commented 4 years ago

OK – yes, I developed altair_viewer as an alternative to the functionality here, partly because I know the maintenance burden of being a "recommended" solution for a project like Altair :smile:

jpivarski commented 4 years ago

If altair_viewer reproduces VegaScope's functionality—i.e. if you can use it from plain Python (no IPython or Jupyter) and through an ssh tunnel—then I can retire VegaScope and add a prominent link pointing to altair_viewer. Is that true of altair_viewer: does it support the same use cases (and possibly more)?

aschoenauer-sebag commented 4 years ago

Looking this up on altair-viz/altair#1939, it appears that altair_viewer is a viable alternative.

altair_viewer works like a charm, thank you!

jakevdp commented 4 years ago

Is that true of altair_viewer: does it support the same use cases (and possibly more)?

Yes - although it lacks some of the polish of vegascope (e.g. dynamic resizing, etc.)