vegascope
vegascope copied to clipboard
Altair says VegaScope is not installed, but it is
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
- Ubuntu 18.04
- python 3.7.0
- iPython 7.12.0
- altair 4.0.1
- vegascope 1.0.14
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
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:
- Whether you use pip or conda to install packages, or both
- The value of your
PYTHONPATH
environment variable - The value of
import sys; sys.path
in Python - ...?
Basically, Python installation questions.
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
I believe vegascope does not yet support the Altair v4 renderer entrypoint: https://github.com/scikit-hep/vegascope/blob/08cd5a3983cea8a057c7d17d548d463ba1ca4900/setup.py#L56
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?
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.
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:
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)?
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!
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.)