jupyterhub / binderhub

Run your code in the cloud, with technology so advanced, it feels like magic!
https://binderhub.readthedocs.io
BSD 3-Clause "New" or "Revised" License
2.51k stars 383 forks source link

Can't make Binder work with geoviews #382

Closed Alexander-Radionov closed 6 years ago

Alexander-Radionov commented 6 years ago

Config file (without geoviews included): environment.yml

-channels:      
 -  - conda-forge       
 -  - ioam/label/dev        
 -  - defaults      
 -      
 -dependencies:     
 -  - xarray==0.10.0        
 -  - python        
 -  - holoviews==1.9.2      
 -  - numpy==1.13.1     
 -  - pandas==0.20.3        
 -  - geopandas==0.3.0      
 -  - bokeh==0.12.13        
 -  - ipython==6.1.0        
 -  - ipywidgets==7.0.0 

Repo link

...but if I try to add geoviews dependency in the config file, Binder's conda gives me this error stack trace (geoviews==1.4.2):

    conda-build version : not installed
         python version : 3.6.1.final.0
       requests version : 2.18.4
       root environment : /srv/conda  (writable)
    default environment : /srv/conda
       envs directories : /srv/conda/envs
                          /home/jovyan/.conda/envs
          package cache : /srv/conda/pkgs
                          /home/jovyan/.conda/pkgs
           channel URLs : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.continuum.io/pkgs/main/linux-64
                          https://repo.continuum.io/pkgs/main/noarch
                          https://repo.continuum.io/pkgs/free/linux-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/linux-64
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/linux-64
                          https://repo.continuum.io/pkgs/pro/noarch
            config file : /srv/conda/.condarc
      File "/srv/conda/lib/python3.6/site-packages/conda_env/cli/main_update.py", line 106, in execute
        installer.install(prefix, specs, args, env, prune=args.prune)
      File "/srv/conda/lib/python3.6/site-packages/conda_env/installers/conda.py", line 32, in install
        channel_priority_map=_channel_priority_map)
      File "/srv/conda/lib/python3.6/site-packages/conda/plan.py", line 475, in install_actions_list
        dists_for_envs = determine_all_envs(r, specs, channel_priority_map=channel_priority_map)
      File "/srv/conda/lib/python3.6/site-packages/conda/plan.py", line 540, in determine_all_envs
        spec_for_envs = tuple(SpecForEnv(env=p.preferred_env, spec=p.name) for p in best_pkgs)
      File "/srv/conda/lib/python3.6/site-packages/conda/plan.py", line 540, in <genexpr>
        spec_for_envs = tuple(SpecForEnv(env=p.preferred_env, spec=p.name) for p in best_pkgs)
      File "/srv/conda/lib/python3.6/site-packages/conda/plan.py", line 539, in <genexpr>
        best_pkgs = (r.index[r.get_dists_for_spec(s, emptyok=False)[-1]] for s in specs)
      File "/srv/conda/lib/python3.6/site-packages/conda/resolve.py", line 563, in get_dists_for_spec
        raise ResolvePackageNotFound([(ms,)])
    conda.exceptions.ResolvePackageNotFound:
      - geoviews ==1.4.2

If geoviews version is not specified:

Traceback (most recent call last):
      File "/srv/conda/lib/python3.6/site-packages/conda/exceptions.py", line 640, in conda_exception_handler
        return_value = func(*args, **kwargs)
      File "/srv/conda/lib/python3.6/site-packages/conda_env/cli/main_update.py", line 106, in execute
        installer.install(prefix, specs, args, env, prune=args.prune)
      File "/srv/conda/lib/python3.6/site-packages/conda_env/installers/conda.py", line 32, in install
        channel_priority_map=_channel_priority_map)
      File "/srv/conda/lib/python3.6/site-packages/conda/plan.py", line 489, in install_actions_list
        for specs_by_prefix in required_solves]
      File "/srv/conda/lib/python3.6/site-packages/conda/plan.py", line 489, in <listcomp>
        for specs_by_prefix in required_solves]
      File "/srv/conda/lib/python3.6/site-packages/conda/plan.py", line 489, in install_actions_list
        for specs_by_prefix in required_solves]
      File "/srv/conda/lib/python3.6/site-packages/conda/plan.py", line 489, in <listcomp>
        for specs_by_prefix in required_solves]
      File "/srv/conda/lib/python3.6/site-packages/conda/plan.py", line 631, in get_actions_for_dists
        pkgs = r.install(specs, installed, update_deps=update_deps)
      File "/srv/conda/lib/python3.6/site-packages/conda/resolve.py", line 813, in install
        pkgs = self.solve(specs, returnall=returnall)
      File "/srv/conda/lib/python3.6/site-packages/conda/resolve.py", line 868, in solve
        self.find_conflicts(specs)
      File "/srv/conda/lib/python3.6/site-packages/conda/resolve.py", line 369, in find_conflicts
        raise UnsatisfiableError(bad_deps)
    conda.exceptions.UnsatisfiableError: The following specifications were found to be in conflict:
      - geoviews -> python 3.4* -> xz 5.0.5
      - python 3.6*
    Use "conda info <package>" to see the dependencies for each package.

I think it may be connected with this issue of geoviews.

choldgraf commented 6 years ago

maybe @mrocklin has some thoughts on this? I wonder if errors w/ Bokeh are because it needs another port to run the server on?

does this not work for any interactive widget setup? See this repo for a working example w/ ipywidgets:

https://github.com/binder-examples/jupyter-extension

maybe that will point you in the right direction

mrocklin commented 6 years ago

cc @bryevdv

bryevdv commented 6 years ago

Pure Bokeh maps (both google map and tile source maps) are working fine for me in Binder in the tutorial notebooks:

screen shot 2017-12-29 at 18 34 12 screen shot 2017-12-29 at 18 35 10

This notebook is runnable on binder using Bokeh 0.12.13 at:

https://hub.mybinder.org/user/bokeh-bokeh-notebooks-f0rpou6q/notebooks/tutorial/09%20-%20Geographic%20Plots.ipynb

So maybe this is a holoviews issue with DynamicMap specifically, I'm not sure sure at all. cc @jlstevens @philippjfr @jbednar

choldgraf commented 6 years ago

ah cool @bryevdv - maybe this is a setup issue and not a bug issue then. Two quick thoughts:

  1. Just a note that when sharing binder links, you can't actually share the URL of the hub instance created for you, that's unique to your computer. Instead you should share the "binder url" for that repo:

    https://mybinder.org/v2/gh/bokeh/bokeh-notebooks/master?filepath=tutorial%2F00%20-%20Introduction%20and%20Setup.ipynb

  2. That's a useful tutorial repo, I'll create a binder-examples repo for the continuum JS stack so people can use that as a guide

Alexander-Radionov commented 6 years ago

@choldgraf I opened your link and here is what I see there: image and an empty cell at the bottom.

choldgraf commented 6 years ago

Hmmm, it worked for me. What browser/browser version are you on?

choldgraf commented 6 years ago

Also can you see if there are any errors in the javascript console for your browser?

Alexander-Radionov commented 6 years ago

Google chrome, 63.0.3239.84 Yes, there are some errors: image image

Full first link (one with 404)

bryevdv commented 6 years ago

Those loads are definitely not initiated by Bokeh

choldgraf commented 6 years ago

@bryevdv do you think it's most likely another extension conflicting with the javascript?

choldgraf commented 6 years ago

I guess à related question is whether @alexander-radionov can get bokeh to work just fine on their own machine (w the same versions etc). Does it work for you locally Alexander?

Alexander-Radionov commented 6 years ago

@choldgraf Yep. Locally it works fine. Factor maps are now visible too (didn't notice them first time opening your Binder link).

It seems odd to me. I thought Binder run the notebooks and then I just have to load an image and thus don't have to have any libs or extensions.

bryevdv commented 6 years ago

@Alexander-Radionov not at all, Binder is for you to be able to execute real, live, actual jupyter notebooks, backed by a running jupyter kernel. In particular, in the image above with the IFrame, it's not going to actually render the iframe (and hence the remote Bokeh app it links to) until you execute the cell for real. Did you hit shift-enter in that cell to execute it?

bryevdv commented 6 years ago

re: the 404s for momentjs loads, I don't think they are related to Bokeh in any way

Alexander-Radionov commented 6 years ago

@bryevdv Seems you are right and I did a stupid mistake, sorry. Now I see all outputs at 00 example.

Alexander-Radionov commented 6 years ago

I think I know whath's the problem with my notebook: outputs are empty because of absence of geoviews module in environment.yml. With this info, should I edit issue's title and my starting message?

...but if I try to add this in the config file, Binder's conda gives me this error stack trace (geoviews==1.4.2):

    conda-build version : not installed
         python version : 3.6.1.final.0
       requests version : 2.18.4
       root environment : /srv/conda  (writable)
    default environment : /srv/conda
       envs directories : /srv/conda/envs
                          /home/jovyan/.conda/envs
          package cache : /srv/conda/pkgs
                          /home/jovyan/.conda/pkgs
           channel URLs : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.continuum.io/pkgs/main/linux-64
                          https://repo.continuum.io/pkgs/main/noarch
                          https://repo.continuum.io/pkgs/free/linux-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/linux-64
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/linux-64
                          https://repo.continuum.io/pkgs/pro/noarch
            config file : /srv/conda/.condarc
      File "/srv/conda/lib/python3.6/site-packages/conda_env/cli/main_update.py", line 106, in execute
        installer.install(prefix, specs, args, env, prune=args.prune)
      File "/srv/conda/lib/python3.6/site-packages/conda_env/installers/conda.py", line 32, in install
        channel_priority_map=_channel_priority_map)
      File "/srv/conda/lib/python3.6/site-packages/conda/plan.py", line 475, in install_actions_list
        dists_for_envs = determine_all_envs(r, specs, channel_priority_map=channel_priority_map)
      File "/srv/conda/lib/python3.6/site-packages/conda/plan.py", line 540, in determine_all_envs
        spec_for_envs = tuple(SpecForEnv(env=p.preferred_env, spec=p.name) for p in best_pkgs)
      File "/srv/conda/lib/python3.6/site-packages/conda/plan.py", line 540, in <genexpr>
        spec_for_envs = tuple(SpecForEnv(env=p.preferred_env, spec=p.name) for p in best_pkgs)
      File "/srv/conda/lib/python3.6/site-packages/conda/plan.py", line 539, in <genexpr>
        best_pkgs = (r.index[r.get_dists_for_spec(s, emptyok=False)[-1]] for s in specs)
      File "/srv/conda/lib/python3.6/site-packages/conda/resolve.py", line 563, in get_dists_for_spec
        raise ResolvePackageNotFound([(ms,)])
    conda.exceptions.ResolvePackageNotFound:
      - geoviews ==1.4.2

If geoviews version is not specified:

Traceback (most recent call last):
      File "/srv/conda/lib/python3.6/site-packages/conda/exceptions.py", line 640, in conda_exception_handler
        return_value = func(*args, **kwargs)
      File "/srv/conda/lib/python3.6/site-packages/conda_env/cli/main_update.py", line 106, in execute
        installer.install(prefix, specs, args, env, prune=args.prune)
      File "/srv/conda/lib/python3.6/site-packages/conda_env/installers/conda.py", line 32, in install
        channel_priority_map=_channel_priority_map)
      File "/srv/conda/lib/python3.6/site-packages/conda/plan.py", line 489, in install_actions_list
        for specs_by_prefix in required_solves]
      File "/srv/conda/lib/python3.6/site-packages/conda/plan.py", line 489, in <listcomp>
        for specs_by_prefix in required_solves]
      File "/srv/conda/lib/python3.6/site-packages/conda/plan.py", line 489, in install_actions_list
        for specs_by_prefix in required_solves]
      File "/srv/conda/lib/python3.6/site-packages/conda/plan.py", line 489, in <listcomp>
        for specs_by_prefix in required_solves]
      File "/srv/conda/lib/python3.6/site-packages/conda/plan.py", line 631, in get_actions_for_dists
        pkgs = r.install(specs, installed, update_deps=update_deps)
      File "/srv/conda/lib/python3.6/site-packages/conda/resolve.py", line 813, in install
        pkgs = self.solve(specs, returnall=returnall)
      File "/srv/conda/lib/python3.6/site-packages/conda/resolve.py", line 868, in solve
        self.find_conflicts(specs)
      File "/srv/conda/lib/python3.6/site-packages/conda/resolve.py", line 369, in find_conflicts
        raise UnsatisfiableError(bad_deps)
    conda.exceptions.UnsatisfiableError: The following specifications were found to be in conflict:
      - geoviews -> python 3.4* -> xz 5.0.5
      - python 3.6*
    Use "conda info <package>" to see the dependencies for each package.

I think it may be connected with this issue of geoviews.

bryevdv commented 6 years ago

No worries, glad it's working

choldgraf commented 6 years ago

Yes! Please update the title and first post to match the current state of the issue :-)

choldgraf commented 6 years ago

And glad to hear you got it partially working!

raybellwaves commented 6 years ago

I was going to report this issue but this sub helped me fix it. I originally had ioam in the dependencies and was getting the error ResolvePackageNotFound: ioam. I guess I was confused as you can install ioam from the conda-forge channel following instructions from geoviews http://geo.holoviews.org/ I simply moved it to the channels and pinned the version of goeviews (not sure if I needed to pin the version thought).

My suggestion for a fix is make the error message ResolvePackageNotFound: ioam to tell you to move ioam to the channel list but it's very specific and i'm not sure how easy it is to implement it.

For reference my folder is: https://github.com/raybellwaves/rot-eof-dev

jbednar commented 6 years ago

ioam is a conda channel, not a conda package, so it is not installable. GeoViews is being released today or tomorrow, but in the meantime you can follow the instructions at pyviz.org to install it (conda install -c pyviz pyviz).

choldgraf commented 6 years ago

@jbednar do you know if Binder does, now, work with Geoviews? (aka, is this issue resolved?)

raybellwaves commented 6 years ago

@jbednar ah thanks. I assumed conda install -c conda-forge -c ioam holoviews geoviews was installing everything from conda-forge. Whereas, now I see the -c before ioam means channel.

@choldgraf Geoviews works as well in Binder as it does as the notebook on my laptop. Once I realized my mistake in my installation it was fine. In my opinion you can close this.

jbednar commented 6 years ago

I also just verified a few seconds ago that it works fine when pointed to https://github.com/pyviz/pyviz ; the notebooks I tried work, including cells with GeoViews, apart from things that need data downloaded. So I agree, it can be closed.

choldgraf commented 6 years ago

I just ran the pyviz binder and it's awesome! woot! ok I'm gonna close this