Giter Club home page Giter Club logo

Comments (3)

astrojuanlu avatar astrojuanlu commented on July 30, 2024 1

Thank you @andrewosh, adding python=3.4 to environment.yml indeed fixed the issue. Also your explanation on the file handling was spot on, since !conda list won't show the packages available from the path and that can be confusing. Closing!

from binder.

maxalbert avatar maxalbert commented on July 30, 2024

I'm having the same problem. This is my repository:

https://github.com/maxalbert/paper-supplement-nanoparticle-sensing

The corresponding binder is here:

http://mybinder.org/repo/maxalbert/paper-supplement-nanoparticle-sensing

If I am not mistaken then the problem seems to be that the conda environment created by binder is somehow not activated in the docker container (even though the log file claims that it is). For example, when I open one of my notebooks and run !conda env list in a new cell, this is the output I get:

# conda environments:
#
binder                   /home/main/anaconda2/envs/binder
python3                  /home/main/anaconda2/envs/python3
root                  *  /home/main/anaconda2

The binder environment is the one created from my environment.yml file, but the root environment is the one that is activated. Any chance to fix this? Many thanks!

from binder.

andrewosh avatar andrewosh commented on July 30, 2024

@Juanlu001 @maxalbert thanks for opening up this issue. The environment.yml handling that we're doing right now has definitely been a source of confusion, so we really should add some documentation here.

The immediate fix to your problem is to explicitly specify the Python version you'd like to use inside of your environment.yml file (just like here: https://github.com/binder-project/example-conda-environment/blob/master/environment.yml). With that line included, the default kernel will be Python 3.4, and the packages in the file will be available.

If you check out how we handle the files here: https://github.com/binder-project/binder/blob/master/binder/app.py#L204, you'll see that we aren't explicitly source activateing the environment, because that doesn't behave well during the Docker build process, but we are manipulating the path in such a way that the binder environment the first environment searched for packages.

From inside the binder-project/example-conda-environment binder:

import sys
sys.path
['',
 '/home/main/anaconda2/envs/binder/lib/python34.zip',
 '/home/main/anaconda2/envs/binder/lib/python3.4',
 '/home/main/anaconda2/envs/binder/lib/python3.4/plat-linux',
 '/home/main/anaconda2/envs/binder/lib/python3.4/lib-dynload',
 '/home/main/anaconda2/envs/binder/lib/python3.4/site-packages/setuptools-20.7.0-py3.4.egg',
 '/home/main/anaconda2/envs/binder/lib/python3.4/site-packages',
 '/home/main/anaconda2/envs/binder/lib/python3.4/site-packages/IPython/extensions',
 '/home/main/.ipython']

from binder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.