Not able to install Git extension in my Jupyter notebook opened through Binder

I am new to coding, can you guys suggest how to go ahead . I am stuck for some time now. Sometimes the build fails showing 504 error and sometimes the environment is inconsistent, please check the package plan carefully
The following packages are causing the inconsistency:

  • defaults/osx-64::_ipyw_jlab_nb_ext_conf==0.1.0=py38_0
  • defaults/osx-64::anaconda==2021.05=py38_0

MyBinder.org (and to my knowledge all other binders) run user environments in in Linux containers, so manually-specified dependencies on osx packages would definitely cause a problem!

If this a local issue: installing new things into the anaconda base environment can be peril-fraught. Some options:

  • upgrade anaconda (there’s probably a newer release, maybe it will work with what you’re trying to install)
  • create a smaller conda environment that has just the things you need for the notebook in question
2 Likes

Can you guide me how to create a smaller conda environment. I am basically learning a Geo-Python course in which I had an assignment where I have to use Git to update my exercises. But I’m stuck at the first step, the extension is not getting installed. I don’t have coding background so please it would be very kind of you guys to suggest how to get this thing done.

I opened a binder notebook through Jupyterlab git extension page, in that notebook git extension is already installed and showing on the extension manager as well.

  • create an environment.yml that has all the things you need.

    • If you’ve been using binder, the repo it came from probably has one, as the heavy geo stuff was a big motivator for conda-forge existing in the first place, so all of the binary pieces works together.
    name: my-notebook-env
    channels:
      - conda-forge
      - nodefaults
    dependencies:
      - jupyterlab-git  >=0.34  
      - jupyterlab >=3,<4
      - git
      - python >=3.9,<3.10 # for example
      - geopandas          # for example, brings in pandas, numpy, gdal, etc.
      - ipyleaflet         # for example, brings in ipywidgets, etc
    
  • open an Anaconda Prompt or otherwise “activate” the anaconda base env

    source /path/to/anaconda/bin/activate
    # or on windows
    call C:\Path\To\Anaconda\Scripts\activate
    
  • create the new env

    conda env update --file environment.yml --name my-notebook-env
    
    • it’s safer/faster/more reliable to call conda env update over and over again, and generally more stable than conda installing each little thing interactive
  • activate the new env

    source activate my-notebook-env
    # or on windows
    activate my-notebook-env
    
  • start jupyterlab in the directory where your repo is

    cd path/to/repo
    jupyter lab --debug
    
  • if you run into problems, capture the logs, they are very helpful

3 Likes