Giter Site home page Giter Site logo

anaconda / nb_conda Goto Github PK

View Code? Open in Web Editor NEW
138.0 138.0 32.0 141 KB

Conda environment and package access extension from within Jupyter

License: BSD 3-Clause "New" or "Revised" License

Python 72.29% JavaScript 24.58% CSS 0.50% HTML 2.13% Batchfile 0.26% Shell 0.23%

nb_conda's People

Contributors

awkwong-whi avatar bollwyvl avatar damianavila avatar fjcapdevila avatar kalefranz avatar malev avatar mcg1969 avatar mmarchetti avatar parente avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nb_conda's Issues

[ Bug ] Conda Tab Environment Cloning Causes Server Lag

Issue

When cloning a conda environment through the "Conda" tab in jupyterhub/jupyterlab, the jupyterhub instance becomes unresponsive. Accessing the jupyterhub instance returns a "504 Gateway Time-out". The downtime usually lasts about 5 minutes on my server. Note also that only the jupyterhub instance is unresponsive; other applications running on the same server (in separate LXD containers) are not affected.

When the server is up again, I can see that the desired environment has been created successfully. The new environment is usable with no issues.

This seems to be a problem with nb_conda: cloning an environment through bash, e.g. using conda create -n test2 --clone test1, does not cause any noticeable server issues.

Set-up

I have jupyterhub installed in a dedicated LXD container on my server computer, which also contains several other concurrently running containers running other server applications.

System Info

Host info

OS: Ubuntu 18.04.1
LXD: 3.5 (snap)

Guest info

OS: Ubuntu 18.04.1
Conda packages:

python 3.6.6 h5001a0f_0 conda-forge
conda 4.5.11 py36_0 conda-forge
conda-env 2.6.0 1 conda-forge
jupyter_client 5.2.3 py_1 conda-forge
jupyter_core 4.4.0 py_0 conda-forge
jupyterhub 0.9.4 py36_0 conda-forge
nb_conda 2.2.1 py36_0 conda-forge
nb_conda_kernels 2.1.1 py36_1 conda-forge

On OSX package fails in post-link nb_conda-0.1.0-py27_0

$ conda create -n nb -c anaconda-notebook nb_conda
Fetching package metadata: ......
Solving package specifications: .....................................................................
Package plan for installation in environment /Users/ijstokes/anaconda/envs/nb:

The following NEW packages will be INSTALLED:

    appnope:            0.1.0-py27_0   defaults         
    backports_abc:      0.4-py27_0     defaults         
    decorator:          4.0.4-py27_0   defaults         
    funcsigs:           0.4-py27_0     defaults         
    ipykernel:          4.1.1-py27_0   defaults         
    ipyparallel:        4.1.0-py27_0   defaults         
    ipython:            4.0.1-py27_0   defaults         
    ipython_genutils:   0.1.0-py27_0   defaults         
    ipywidgets:         4.1.0-py27_0   defaults         
    jinja2:             2.8-py27_0     defaults         
    jsonpointer:        1.9-py27_0     anaconda-notebook
    jsonschema:         2.4.0-py27_0   defaults         
    jupyter_client:     4.1.1-py27_0   defaults         
    jupyter_core:       4.0.6-py27_0   defaults         
    markupsafe:         0.23-py27_0    defaults         
    mistune:            0.7.1-py27_0   defaults         
    nb_conda:           0.1.0-py27_0   anaconda-notebook
    nbconvert:          4.0.0-py27_0   defaults         
    nbformat:           4.0.1-py27_0   defaults         
    nbwrapper:          0.1.0-py27_0   anaconda-notebook
    notebook:           4.0.6-py27_0   defaults         
    openssl:            1.0.2d-0       defaults         
    pandoc:             1.12.3-0       anaconda-notebook
    path.py:            8.1.2-py27_1   defaults         
    pexpect:            3.3-py27_0     defaults         
    pickleshare:        0.5-py27_0     defaults         
    pip:                7.1.2-py27_0   defaults         
    ptyprocess:         0.5-py27_0     defaults         
    pygments:           2.0.2-py27_0   defaults         
    python:             2.7.11-0       defaults         
    python.app:         1.2-py27_4     defaults         
    pyzmq:              14.7.0-py27_1  defaults         
    readline:           6.2-2          defaults         
    setuptools:         18.5-py27_0    defaults         
    simplegeneric:      0.8.1-py27_0   defaults         
    singledispatch:     3.4.0.3-py27_0 defaults         
    six:                1.10.0-py27_0  defaults         
    sqlite:             3.8.4.1-1      defaults         
    ssl_match_hostname: 3.4.0.2-py27_0 defaults         
    terminado:          0.5-py27_1     defaults         
    tk:                 8.5.18-0       defaults         
    tornado:            4.3-py27_0     defaults         
    traitlets:          4.0.0-py27_0   defaults         
    wheel:              0.26.0-py27_1  defaults         
    zeromq:             4.1.3-0        defaults         
    zlib:               1.2.8-0        defaults         

Proceed ([y]/n)? y

Linking packages ...
[nbformat            ]|#############################################/Users/ijstokes/anaconda/envs/nb/bin/python: No module named nb_conda.install
Error: Error: post-link failed for: nb_conda-0.1.0-py27_0########################################  |  97%

temporary conda environments for each notebook

My research lab uses a central install of anaconda, and we all use Jupyter notebooks + nb_conda, which is great! However, we have an issue with trying to balance two things:

  1. Keeping each notebook fully reproducible (optimally, the conda environment for each notebook remains static forever)
  2. Limiting the number of separate conda environments (we don't want a huge list of environments to select from, and a huge number of files on the file system)

We haven't been able to figure out a good way of doing this. Everyone needs different software (or versions) for each project, and when new software is installed into existing conda environments, this can change the environment and "break" old notebooks that used that conda environment.

We've been dealing with this issue by just listing the software in the conda environment when the notebook was run. More specifically, we use sessionInfo() for R kernels or ! conda list -n MY_NOTEBOOK_CONDA_ENV for python kernels. This is not optimal, given that we would still need to create a new conda environment to re-run these notebooks, which inflates the total number of conda environments.

I really like how snakemake handles conda environments, where it creates specific conda environments for specific rules, and only if those rules are used. I'm wondering if this could be implemented in nb_conda for better reproducibility of Jupyter notebooks. The user could provide a yaml-formatted list of conda packages (possibly in the notebook metadata), then a temporary conda environment is created just for running the notebook. Once the user shuts down the kernel, the conda environment is also removed (unless the user wants to keep it for faster re-running later).

Is this idea feasible?

Tests not working for master

In the .travis.yml I find the following:

conda install -n nb_conda -c conda-forge --file requirements.txt

This means that the tests do not really mean anything for master.

Get building locally on Windows-64, Python 3.5

https://anaconda.org/anaconda-nb-extensions/nb_conda/builds/5/14

391WARNING:root:Environment name starts with underscore '_'.  Skipping menu installation.

392

393C:\Users\binstar\builds\anaconda-nb-extensions\nb_conda\source>"C:\Users\binstar\Miniconda\envs\_test\bin\python" -m nb_conda.setup install --enable --prefix="C:\Users\binstar\Miniconda\envs\_test" 

394The system cannot find the path specified.

395Error: post-link failed for: nb_conda-0.1.2-py35_0_g4fda71b

396Exit BINSTAR_BUILD_RESULT=failure

Excluding directories?

Is it possible to exclude directories?

I would like to exclude the main /opt/conda directory so the main Python 3 doesn't get relabeled in the New notebook drop down and also I have a Python 2 environment I don't want to be handled in the Conda environments tab.

I also seem to be getting some weird message for an environment that doesn't exist the first time I visit the Conda tab:

An error occurred while retrieving installed packages.
EnvironmentLocationNotFound: Not a conda environment: /opt/conda/envs/conda

Mostly, is there any way we can exclude some directories? Example: exclude top level /opt/conda and then exclude /opt/conda/envs/python2? Then just allow them to create environments in the Conda tab?

conda tab gives an error - AttributeError: 'dict' object has no attribute 'rsplit'

I get this error when starting Jupyter notebook and clicking on Conda tab in the browser:

[E 15:14:49.783 NotebookApp] Unhandled error in API request
...
File "/XXX/lib/python3.5/site-packages/nb_conda/envmanager.py", line 17, in pkg_info
name, version, build = s.rsplit('-', 2)
AttributeError: 'dict' object has no attribute 'rsplit'

Replacing the problematic line with
name, version, build = s["dist_name"].rsplit('-', 2)
fixes the issue but I'm not sure how or whether the grand scheme of things is affected.

Clearly function pkg_info expects a string but env_packages passes a dictionary.
Conda list returns effectively a list of dictionaries and there seems to be confusion about processing this list.
This is using
conda 4.3.13
nb_conda 2.0.0 py35_0

The current version of envmanager.py seems identical to v 2.0

Is `nb_conda` broken?

I freshly installed Anaconda and next also nb_conda. However, when starting Jupyter, I don't see the Conda nor, nor a list of the available environments (as kernels).

The steps I took are:

bash ~/Download/Anaconda3-4.4.0-MacOSX-x86_64.sh
conda update --all
conda install nb_conda
conda create --name foo python=3 jupyter

Next I started Jupyter either from the root environment or from foo. In both cases, I couldn't see the list of available environments. I am not sure whether it makes sense or not, I also tried: jupyter nbextension enable nb_conda --user but it yielded:

Enabling notebook extension nb_conda...
      - Validating: problems found:
        - require?  X nb_conda

For reference, here is the output of conda list (from the root env):

_license                  1.1                      py36_1
_nb_ext_conf              0.4.0                    py36_0
alabaster                 0.7.10                   py36_0
anaconda                  4.4.0               np112py36_0
anaconda-client           1.6.3                    py36_0
anaconda-navigator        1.6.2                    py36_0
anaconda-project          0.6.0                    py36_0
appnope                   0.1.0                    py36_0
appscript                 1.0.1                    py36_0
asn1crypto                0.22.0                   py36_0
astroid                   1.4.9                    py36_0
astropy                   1.3.2               np112py36_0
babel                     2.4.0                    py36_0
backports                 1.0                      py36_0
beautifulsoup4            4.6.0                    py36_0
bitarray                  0.8.1                    py36_0
blaze                     0.10.1                   py36_0
bleach                    1.5.0                    py36_0
bokeh                     0.12.5                   py36_1
boto                      2.46.1                   py36_0
bottleneck                1.2.1               np112py36_0
cffi                      1.10.0                   py36_0
chardet                   3.0.3                    py36_0
click                     6.7                      py36_0
cloudpickle               0.2.2                    py36_0
clyent                    1.2.2                    py36_0
colorama                  0.3.9                    py36_0
conda                     4.3.22                   py36_0
conda-env                 2.6.0                         0
contextlib2               0.5.5                    py36_0
cryptography              1.8.1                    py36_0
curl                      7.52.1                        0
cycler                    0.10.0                   py36_0
cython                    0.25.2                   py36_0
cytoolz                   0.8.2                    py36_0
dask                      0.14.3                   py36_1
datashape                 0.5.4                    py36_0
decorator                 4.0.11                   py36_0
distributed               1.16.3                   py36_0
docutils                  0.13.1                   py36_0
entrypoints               0.2.2                    py36_1
et_xmlfile                1.0.1                    py36_0
fastcache                 1.0.2                    py36_1
flask                     0.12.2                   py36_0
flask-cors                3.0.2                    py36_0
freetype                  2.5.5                         2
get_terminal_size         1.0.0                    py36_0
gevent                    1.2.1                    py36_0
greenlet                  0.4.12                   py36_0
h5py                      2.7.0               np112py36_0
hdf5                      1.8.17                        1
heapdict                  1.0.0                    py36_1
html5lib                  0.999                    py36_0
icu                       54.1                          0
idna                      2.5                      py36_0
imagesize                 0.7.1                    py36_0
ipykernel                 4.6.1                    py36_0
ipython                   5.3.0                    py36_0
ipython_genutils          0.2.0                    py36_0
ipywidgets                6.0.0                    py36_0
isort                     4.2.5                    py36_0
itsdangerous              0.24                     py36_0
jbig                      2.1                           0
jdcal                     1.3                      py36_0
jedi                      0.10.2                   py36_2
jinja2                    2.9.6                    py36_0
jpeg                      9b                            0
jsonschema                2.6.0                    py36_0
jupyter                   1.0.0                    py36_3
jupyter_client            5.0.1                    py36_0
jupyter_console           5.1.0                    py36_0
jupyter_core              4.3.0                    py36_0
lazy-object-proxy         1.2.2                    py36_0
libiconv                  1.14                          0
libpng                    1.6.27                        0
libtiff                   4.0.6                         3
libxml2                   2.9.4                         0
libxslt                   1.1.29                        0
llvmlite                  0.18.0                   py36_0
locket                    0.2.0                    py36_1
lxml                      3.7.3                    py36_0
markupsafe                0.23                     py36_2
matplotlib                2.0.2               np112py36_0
mistune                   0.7.4                    py36_0
mkl                       2017.0.1                      0
mkl-service               1.1.2                    py36_3
mpmath                    0.19                     py36_1
msgpack-python            0.4.8                    py36_0
multipledispatch          0.4.9                    py36_0
navigator-updater         0.1.0                    py36_0
nb_anacondacloud          1.4.0                    py36_0
nb_conda                  2.2.0                    py36_0
nb_conda_kernels          2.1.0                    py36_0
nbconvert                 5.1.1                    py36_0
nbformat                  4.3.0                    py36_0
nbpresent                 3.0.2                    py36_0
networkx                  1.11                     py36_0
nltk                      3.2.3                    py36_0
nose                      1.3.7                    py36_1
notebook                  5.0.0                    py36_0
numba                     0.33.0              np112py36_0
numexpr                   2.6.2               np112py36_0
numpy                     1.12.1                   py36_0
numpydoc                  0.6.0                    py36_0
odo                       0.5.0                    py36_1
olefile                   0.44                     py36_0
openpyxl                  2.4.7                    py36_0
openssl                   1.0.2l                        0
packaging                 16.8                     py36_0
pandas                    0.20.1              np112py36_0
pandocfilters             1.4.1                    py36_0
partd                     0.3.8                    py36_0
path.py                   10.3.1                   py36_0
pathlib2                  2.2.1                    py36_0
patsy                     0.4.1                    py36_0
pep8                      1.7.0                    py36_0
pexpect                   4.2.1                    py36_0
pickleshare               0.7.4                    py36_0
pillow                    4.1.1                    py36_0
pip                       9.0.1                    py36_1
ply                       3.10                     py36_0
prompt_toolkit            1.0.14                   py36_0
psutil                    5.2.2                    py36_0
ptyprocess                0.5.1                    py36_0
py                        1.4.33                   py36_0
pycosat                   0.6.2                    py36_0
pycparser                 2.17                     py36_0
pycrypto                  2.6.1                    py36_6
pycurl                    7.43.0                   py36_2
pyflakes                  1.5.0                    py36_0
pygments                  2.2.0                    py36_0
pylint                    1.6.4                    py36_1
pyodbc                    4.0.16                   py36_0
pyopenssl                 17.0.0                   py36_0
pyparsing                 2.1.4                    py36_0
pyqt                      5.6.0                    py36_1
pytables                  3.3.0               np112py36_0
pytest                    3.0.7                    py36_0
python                    3.6.1                         2
python-dateutil           2.6.0                    py36_0
python.app                1.2                      py36_4
pytz                      2017.2                   py36_0
pywavelets                0.5.2               np112py36_0
pyyaml                    3.12                     py36_0
pyzmq                     16.0.2                   py36_0
qt                        5.6.2                         2
qtawesome                 0.4.4                    py36_0
qtconsole                 4.3.0                    py36_0
qtpy                      1.2.1                    py36_0
readline                  6.2                           2
requests                  2.14.2                   py36_0
rope                      0.9.4                    py36_1
ruamel_yaml               0.11.14                  py36_1
scikit-image              0.13.0              np112py36_0
scikit-learn              0.18.1              np112py36_1
scipy                     0.19.0              np112py36_0
seaborn                   0.7.1                    py36_0
setuptools                27.2.0                   py36_0
simplegeneric             0.8.1                    py36_1
singledispatch            3.4.0.3                  py36_0
sip                       4.18                     py36_0
six                       1.10.0                   py36_0
snowballstemmer           1.2.1                    py36_0
sortedcollections         0.5.3                    py36_0
sortedcontainers          1.5.7                    py36_0
sphinx                    1.5.6                    py36_0
spyder                    3.1.4                    py36_0
sqlalchemy                1.1.9                    py36_0
sqlite                    3.13.0                        0
statsmodels               0.8.0               np112py36_0
sympy                     1.0                      py36_0
tblib                     1.3.2                    py36_0
terminado                 0.6                      py36_0
testpath                  0.3                      py36_0
tk                        8.5.18                        0
toolz                     0.8.2                    py36_0
tornado                   4.5.1                    py36_0
traitlets                 4.3.2                    py36_0
unicodecsv                0.14.1                   py36_0
unixodbc                  2.3.4                         0
wcwidth                   0.1.7                    py36_0
werkzeug                  0.12.2                   py36_0
wheel                     0.29.0                   py36_0
widgetsnbextension        2.0.0                    py36_0
wrapt                     1.10.10                  py36_0
xlrd                      1.0.0                    py36_0
xlsxwriter                0.9.6                    py36_0
xlwings                   0.10.4                   py36_0
xlwt                      1.2.0                    py36_0
xz                        5.2.2                         1
yaml                      0.1.6                         0
zict                      0.1.2                    py36_0
zlib                      1.2.8                         3

Conda environment creation from jupyter failing (JSON parse issue)

Running notebook with nb_conda version 2.2.1 leads to
[W 00:36:26.479 NotebookApp] [nb_conda] JSON parse fail:
Extra data: line 2 column 1 (char 77)
[E 00:36:26.480 NotebookApp] Uncaught exception POST /conda/environments/python3/packages/install (127.0.0.1)
HTTPServerRequest(protocol='https', host='127.0.0.1:8157', method='POST', uri='/conda/environments/python3/packages/install', version='HTTP/1.1', remote_ip='127.0.0.1')
Traceback (most recent call last):
File "/home/ubuntu/anaconda3/envs/python3/lib/python3.6/site-packages/tornado/web.py", line 1541, in _execute
result = method(*self.path_args, **self.path_kwargs)
File "/home/ubuntu/anaconda3/envs/python3/lib/python3.6/site-packages/tornado/web.py", line 2949, in wrapper
return method(self, *args, **kwargs)
File "/home/ubuntu/anaconda3/envs/python3/lib/python3.6/site-packages/notebook/base/handlers.py", line 716, in wrapper
return method(self, *args, **kwargs)
File "/home/ubuntu/anaconda3/envs/python3/lib/python3.6/site-packages/nb_conda/handlers.py", line 136, in post
resp = self.env_manager.install_packages(env, packages)
File "/home/ubuntu/anaconda3/envs/python3/lib/python3.6/site-packages/nb_conda/envmanager.py", line 160, in install_packages
return self.clean_conda_json(output)
File "/home/ubuntu/anaconda3/envs/python3/lib/python3.6/site-packages/nb_conda/envmanager.py", line 101, in clean_conda_json
lines = [line for line in lines if re.match(JSONISH_RE)]
File "/home/ubuntu/anaconda3/envs/python3/lib/python3.6/site-packages/nb_conda/envmanager.py", line 101, in
lines = [line for line in lines if re.match(JSONISH_RE)]
TypeError: match() missing 1 required positional argument: 'string'
[W 00:36:26.482 NotebookApp] Unhandled error
[E 00:36:26.483 NotebookApp] {
"Host": "127.0.0.1:8157",
"Accept": "application/json, text/javascript, /; q=0.01",
"X-Requested-With": "XMLHttpRequest",
"X-Xsrftoken": "2|cee34e7f|0513fedcd5194fd65683eb14d150ba0f|1533157020",
"Accept-Language": "en-us",
"Accept-Encoding": "gzip, deflate",
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
"Origin": "https://127.0.0.1:8157",
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.2 Safari/605.1.15",
"Referer": "https://127.0.0.1:8157/tree?",
"Content-Length": "24",
"Connection": "keep-alive",
"Cookie": "username-127-0-0-1-8157="2|1:0|10:1533157024|23:username-127-0-0-1-8157|44:NTU0MTA5ZWQzYjI5NDg0MWEwODI1NGQ3OGM2MDIxNDY=|43be7266b8ccfeaf2d5f9403a2c5a21d1a7da08b9e11525d716c6c7ee6596167"; _xsrf=2|cee34e7f|0513fedcd5194fd65683eb14d150ba0f|1533157020"
}
[E 00:36:26.483 NotebookApp] 500 POST /conda/environments/python3/packages/install (127.0.0.1) 12146.91ms referer=https://127.0.0.1:8157/tree?

Issues:
jupyterhub/jupyterhub#1844
jupyter/notebook#3815

Failure to fetch channel metadata is confusing at UI and notebook.log levels

Observed Behavior

I run nb_conda behind a corporate firewall in Anaconda Enterprise Notebooks 4.X. I had channels on anaconda.org specified in /opt/wakari/anaconda/.condarc that caused SSL verification errors because I was missing the ssl_verify setting.

When I went to nb_conda's 'Conda' tab in a notebook session, it would sit there for a very long time, trying to fetch the channel metadata and then finally fail. However, the only indication that there was a failure in the nb_conda user-interface was that it finally showed a single checkbox and said "undefined" Packages Available.

confusing_failure_to_enumerate_available_packages

In the notebook.log, the only thing that indicates failure is a 'Status 1' message instead of 'Status 0'.
long_eventual_failure_to_collect_available_packages.txt

Successful fetch of available packages looks like
quick_successful_available_packages.txt

Note that the failure log shows that it took ~2 minutes for the failure to finally resolve

Desired Behavior

  1. It doesn't take conda 2 minutes to try and fetch the channel metadata. The failure should happen faster.
  2. When you get 'Status 1' from conda, the output should:
    • definitely go into the notebook.log
    • optionally be able to be emailed to the AEN administrator
  3. Something better than "undefined" Packages Available should indicate an error happened to the user. Possibly presenting the output of conda to the user letting them know that the admins have been notified. At a minimum, it should tell the user that an error happened and ask them to report it to the admin (using a configurable admin email address). A better solution would allow me to configure nb_conda or AEN as a whole with custom Javascript behind a form that would integrate with our issue tracking system. For example see https://confluence.atlassian.com/adminjiraserver071/advanced-use-of-the-jira-issue-collector-802592648.html

cc: @mrduane I'm skipping the support.continuum.io ticket with this topic but want to at least let you know about it.

Displaying Python [Root] as Python 3?

Is it possible to display "Python [Root]" as "Python 3" using nb_conda? Python [Root] breaks notebooks that were built using the Python 3 environment requiring the kernel to be changed (which isn't a huge deal but one the professors I am working with would prefer not to have to introduce causing more confusion).

conda tab doesn't work

I just recorded a screencast of this problem: http://screencast.com/t/jnBVQlce4

In short:

  1. I created a conda env with:

    conda create -n testaen -c anaconda-nb-extensions -c r -c wakari nb_conda nb_conda_kernels r-essentials
    
  2. I entered that conda environment to run conda:

    source activate testaen
    jupyter notebook
    
  3. I started Jupyter and then tried to go to the Conda tab. I get the error shown in the 2 minute video above. The full log from the start of Jupyter is below:

$ jupyter notebook
[W 16:03:52.822 NotebookApp] Widgets are unavailable. Please install widgetsnbextension or ipywidgets 4.0
[I 16:03:52.832 NotebookApp] The port 8888 is already in use, trying another port.
[I 16:03:52.843 NotebookApp] Serving notebooks from local directory: /Users/ijstokes/code/aetrial/files/assets
[I 16:03:52.843 NotebookApp] 0 active kernels 
[I 16:03:52.843 NotebookApp] The Jupyter Notebook is running at: http://localhost:8889/
[I 16:03:52.843 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 16:04:04.164 NotebookApp] Notebook simon/Flight delays R model.ipynb is not trusted
[I 16:04:04.921 NotebookApp] Kernel started: d0272f60-34bb-4fc8-b256-c51a25cf23a2
[W 16:04:05.358 NotebookApp] 404 GET /nbextensions/widgets/notebook/js/extension.js?v=20160418160352 (::1) 17.64ms referer=http://localhost:8889/notebooks/simon/Flight%20delays%20R%20model.ipynb
[I 16:06:04.761 NotebookApp] Saving file at /simon/Flight delays R model.ipynb
[W 16:06:04.762 NotebookApp] Saving untrusted notebook simon/Flight delays R model.ipynb
[W 16:06:44.134 NotebookApp] 404 GET /environments?_=1461009837436 (::1) 2.19ms referer=http://localhost:8889/tree/simon
[W 16:06:44.136 NotebookApp] 404 GET /packages/available?_=1461009837437 (::1) 0.93ms referer=http://localhost:8889/tree/simon
[W 16:07:08.330 NotebookApp] 404 GET /environments?_=1461009837441 (::1) 1.39ms referer=http://localhost:8889/tree/simon
[W 16:07:08.332 NotebookApp] 404 GET /packages/available?_=1461009837442 (::1) 1.39ms referer=http://localhost:8889/tree/simon

Support for path-based environments

It seems like the path-based environments (i.e. -p) are not supported, are there any plans to support them? (if any, any name-based environment can be used in conda as a path-based one, but not vice versa).

It would be nice to at least be able to use "Conda Packages" functionality for the current conda environment, regardless of whether it's name or path based.

Creating a new R environment doesn't work

From the "Conda" tab in the file browser when I click on "+" to create a new Conda environment if I select "R" then I get a failure. I feel that if the "R" option is presented then picking it should work.

screenshot 2016-07-27 13 59 43

Removing nbpresent

Hello
I just installed this using conda install nb_conda and I'm getting this menu from nbpresent for some options
screen shot 2017-10-28 at 10 51 28 pm
is there anyway to install nb_conda without nbpresent?

Error installing packages: "Not Found"

Steps to repro:

  1. Log in as user
  2. go to project
  3. launch jupyter notebook
  4. go to conda tab
  5. select a large number of packages to install (customer can reproduce reliably with as little as 35 packages)
  6. Expected result: packages are installed and confirmation message updates the user
  7. Actual result: packages ARE installed BUT on-screen error message saying "An error occured while installing packages. Not Found"

environments not shown

Hello,
i try to use nb_kernels via the anaconda-nb-extentions package, using this steps


conda create -n jupyter python=3.5
source activate jupyter
conda install anaconda-nb-extensions -c anaconda-nb-extensions

the installation runs successfully


Enabling nb_conda_kernels...
Enabled nb_conda_kernels

+ /opt/conda/envs/jupyter/bin/jupyter-nbextension enable nbpresent --py --sys-prefix
Enabling notebook extension nbpresent/js/nbpresent.min...
      - Validating: OK
+ /opt/conda/envs/jupyter/bin/jupyter-serverextension enable nbpresent --py --sys-prefix
Enabling: nbpresent
- Writing config: /opt/conda/envs/jupyter/etc/jupyter
    - Validating...
      nbpresent  OK

+ /opt/conda/envs/jupyter/bin/jupyter-nbextension enable nb_anacondacloud --py --sys-prefix
Enabling notebook extension nb_anacondacloud/main...
      - Validating: OK
+ /opt/conda/envs/jupyter/bin/jupyter-serverextension enable nb_anacondacloud --py --sys-prefix
Enabling: nb_anacondacloud
- Writing config: /opt/conda/envs/jupyter/etc/jupyter
    - Validating...
      nb_anacondacloud  OK

+ /opt/conda/envs/jupyter/bin/jupyter-nbextension enable nb_conda --py --sys-prefix
Enabling notebook extension nb_conda/main...
      - Validating: OK
Enabling tree extension nb_conda/tree...
      - Validating: OK
+ /opt/conda/envs/jupyter/bin/jupyter-serverextension enable nb_conda --py --sys-prefix
Enabling: nb_conda
- Writing config: /opt/conda/envs/jupyter/etc/jupyter
    - Validating...
      nb_conda  OK

But I neither have a conda tab nor another kernel to choose beside the default kernel

What am I missing ?

Python 3 Build on conda-forge?

Is there an expectation that someone will push a build of 2.2 targeting python 3.x? I see python2.7 builds on conda-forge and am trying to decide between building myself and installing or just waiting for a build to hit conda-forge?

"root" environment showing twice with an error

The root environment shows up twice once named "root" and once named "miniconda3".

It also shows an error because it tries to find "miniconda3" in the env directory.

nb_conda_kernel_1
nb_conda_kernel_2

I'm nb_conda_kernel version 2.1.0

$ conda info
     active environment : None
       user config file : /home/.../.condarc
 populated config files : 
          conda version : 4.5.11
    conda-build version : not installed
         python version : 3.7.0.final.0
       base environment : /home/.../.local/opt/miniconda3  (writable)
           channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/free/linux-64
                          https://repo.anaconda.com/pkgs/free/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/pro/linux-64
                          https://repo.anaconda.com/pkgs/pro/noarch
          package cache : /home/.../.local/opt/miniconda3/pkgs
                          /home/.../.conda/pkgs
       envs directories : /home/.../.local/opt/miniconda3/envs
                          /home/.../.conda/envs
               platform : linux-64
             user-agent : conda/4.5.11 requests/2.19.1 CPython/3.7.0 Linux/4.15.0-36-generic ubuntu/18.04 glibc/2.27
                UID:GID : 1000:1000
             netrc file : None
           offline mode : False

Run jupyter notebook in a conda env can't change kernel with correct $PATH

I install miniconda and create a env named "startup", then I install jupyter notebook and some extensions in it.
I also create some other envs for different jobs, named like "sci", "gis",..., install required packages in it.

run terminal with:

source activate startup
jupyter-notebook

everything looks great, open an ipynb file and run cell:

import os
os.environ['PATH']

give the path like
/Users/scku/miniconda3/envs/startup/bin:/Users/scku/miniconda3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin"

run:

import sys
sys.path

give the path
['',
'/Users/scku/miniconda3/envs/startup/lib/python36.zip',
'/Users/scku/miniconda3/envs/startup/lib/python3.6',
'/Users/scku/miniconda3/envs/startup/lib/python3.6/lib-dynload',
'/Users/scku/miniconda3/envs/startup/lib/python3.6/site-packages',
'/Users/scku/miniconda3/envs/startup/lib/python3.6/site-packages/IPython/extensions',
'/Users/scku/.ipython']

but when I change kernel by "Kernel" -> "Change kernel" -> "conda env:sci"
run

import os
os.environ['PATH']

get the confusion path (still "starup", no "sci")
'/Users/scku/miniconda3/envs/startup/bin:/Users/scku/miniconda3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin'

run

import sys
sys.path

get the path I expect
['',
'/Users/scku/miniconda3/envs/sci/lib/python36.zip',
'/Users/scku/miniconda3/envs/sci/lib/python3.6',
'/Users/scku/miniconda3/envs/sci/lib/python3.6/lib-dynload',
'/Users/scku/miniconda3/envs/sci/lib/python3.6/site-packages',
'/Users/scku/miniconda3/envs/sci/lib/python3.6/site-packages/IPython/extensions',
'/Users/scku/.ipython']

shouldn't the "changing kernel behavior" like (run with terminal):

#default path
KuShangChende-MacBook-Air:~ scku$ echo $PATH
/Users/scku/miniconda3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin
#startup path + default path
KuShangChende-MacBook-Air:~ scku$ source activate startup
(startup) KuShangChende-MacBook-Air:~ scku$ echo $PATH
/Users/scku/miniconda3/envs/startup/bin:/Users/scku/miniconda3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin
# sci path + startup path + default path
(startup) KuShangChende-MacBook-Air:~ scku$ source activate sci
(sci) KuShangChende-MacBook-Air:~ scku$ echo $PATH
/Users/scku/miniconda3/envs/sci/bin:/Users/scku/miniconda3/envs/startup/bin:/Users/scku/miniconda3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin

Or I missed something? thanks for help.

Error trying to install packages

On the UI, when I try to install a package, I get a forbidden error.

On the notebook, I get the following errors:

notebook stderr: [E 04:45:33.756 NotebookApp] Unhandled error in API request
Traceback (most recent call last):
File "/mnt/nfs/[email protected]/conda_env/envs/jon1/lib/python2.7/site-packages/notebook/base/handlers.py", line 503, in wrapper
result = yield gen.maybe_future(method(self, *args, **kwargs))
File "/mnt/nfs/[email protected]/conda_env/envs/jon1/lib/python2.7/site-packages/nb_conda/handlers.py", line 62, in get
self.finish(json.dumps(self.env_manager.env_packages(env)))
File "/mnt/nfs/[email protected]/conda_env/envs/jon1/lib/python2.7/site-packages/nb_conda/envmanager.py", line 124, in env_packages
"packages": [pkg_info(package) for package in data]
File "/mnt/nfs/[email protected]/conda_env/envs/jon1/lib/python2.7/site-packages/nb_conda/envmanager.py", line 16, in pkg_info
name, version, build = s.rsplit('-', 2)
AttributeError: 'dict' object has no attribute 'rsplit'
[E 04:45:33.771 NotebookApp] {
"Accept-Language": "en-US,en;q=0.8",
"Accept-Encoding": "gzip, deflate, sdch",
"X-Requested-With": "XMLHttpRequest",
"Host": "52.41.180.39:32785",
"Accept": "application/json, text/javascript, /; q=0.01",
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
"Connection": "keep-alive",
"Referer": "http://52.41.180.39:32785/tree",
"Cookie": "xsrf=2|a0fa368e|417be503be862d84e898b478c6bb1bed|1487733014; username-52-41-180-39-32787="2|1:0|10:1487733019|27:username-52-41-180-39-32787|44:OWI4YjQ0Y2Q4Zjk5NDI5NmEyNmZmY2ZlN2JkNjZiMTY=|cd5fd4840f71f946faf1e872391f041fcdafb30ba2fe7ee4699801131fda8db0"; username-52-41-180-39-32786="2|1:0|10:1487733757|27:username-52-41-180-39-32786|44:N2ZlNDBjMzBiODk1NDczNThiYTFjOGIzZjdlYzJmZDY=|994244f06596fe195db2950a3e0cc1eaf07116a0656e0c03720ec33df74f55ad"; username-52-41-180-39-32785="2|1:0|10:1487738258|27:username-52-41-180-39-32785|44:OWZlZWU0MDY0ZTZlNDcyYmEwZWE3NjFjNzkxMzM0YTE=|2785cd2f1bd0098ffbc2bf18109d89f0407458b1650c857cfe25521995040630"; connect.sid=s%3Am1PhgXtpdgDnwYO1DPf71NkVgwBNWkUO.DIr8YCshPx0SiRfv3FMiOTlJWVcrvkBYYvO8nkVTgIA"
}
[E 04:45:33.771 NotebookApp] 500 GET /conda/environments/jon1?
=1487738714673 (70.213.8.242) 9129.27ms referer=http://52.41.180.39:32785/tree

HeartBeat 2017-02-22T04:45:41.279Z SEssion cA2ebFim2XTf9mXzssmlrSq6xtko7Ptn
HeartBeat 2017-02-22T04:45:48.384Z SEssion m1PhgXtpdgDnwYO1DPf71NkVgwBNWkUO
HeartBeat 2017-02-22T04:45:58.755Z SEssion cA2ebFim2XTf9mXzssmlrSq6xtko7Ptn
HeartBeat 2017-02-22T04:46:11.289Z SEssion cA2ebFim2XTf9mXzssmlrSq6xtko7Ptn
HeartBeat 2017-02-22T04:46:18.394Z SEssion m1PhgXtpdgDnwYO1DPf71NkVgwBNWkUO
notebook stderr: [W 04:46:21.143 NotebookApp] 403 POST /conda/environments/jon1/packages/install (70.213.8.242): '_xsrf' argument missing from POST

notebook stderr: [W 04:46:21.156 NotebookApp] 403 POST /conda/environments/jon1/packages/install (70.213.8.242) 12.86ms referer=http://52.41.180.39:32785/tree

#conda in URL isn't sufficient to open page on conda tab

For the tree.js file viewer, the #conda URL mark doesn't cause the page to open at the conda tab. I think this might be an effect of the way the conda tab appears to get automatically patched in to the DOM by the JS, so perhaps the #conda page anchor doesn't actually exist when the page is first loaded. But it means that we can't provide URLs that navigate directly to the Conda tab in the file view, and that is one awesome piece of work I think we should have the ability to get to directly by URL.

nb_conda kernel does not pick up new packages from conda but from pip

Hi all,

nb_conda is a great idea, thanks for that. I'm having a strange issue on a very fresh system.

After

sudo miniconda2/envs/py35data/bin/conda install matplotlib

The respective kernel of nb_conda does not have the package available. It also does not show it in the list of the conda tab. Same holds after restarting even the whole notebook server.

Whereas after

sudo miniconda2/envs/py35data/bin/pip install matplotlib

I'm able to import the package even in the running kernel of py35data. Though the nb_conda tab still doesn't show it.

The kernel definition (which nb_conda generated?) in
miniconda2/envs/py35data/share/jupyter/kernels/python3/kernel.json
seems pretty generic:

{
 "display_name": "Python 3",
 "language": "python",
 "argv": [
  "python",
  "-m",
  "ipykernel_launcher",
  "-f",
  "{connection_file}"
 ]
}

Am I expecting too much here from nb_conda? Why does it pick it up from pip and not from conda?

Thanks for reading,
Fabian

Confused by multiple kernels in same environment

I have a SAS kernel installed in my AEN project environment. It is just another kernel that is part of the "default" environment. But it seems to confuse nb_conda:

screen shot 2016-09-15 at 6 37 18 pm

Here is the text:

Error: environment does not exist: /projects/guest/Demo_SAS_kernel/envs/sas # # Use 'conda create' to create an environment before listing its packages.

Conda tab - Check for update

The following error is raised after pressing the "check for update" button in an environment where at least one package requires an upgrade. No error returned when all packages are UpToDate. Similar error on Linux and Windows platforms with nb_conda2.2.1py36_0 and notebook5.7.4py36_0.

PS: When the updatable package is identified manually it can be updated with "updated selected package" without a problem.

Log from windows below.

home - google chrome 2018-12-30 11 55 46

{
"caused_by": "None",
"error": "DryRunExit: Dry run exiting",
"exception_name": "DryRunExit",
"exception_type": "<class 'conda.exceptions.DryRunExit'>",
"message": "Dry run exiting"
}

[E 11:58:50.783 NotebookApp] Uncaught exception POST /conda/environments/root/packages/check (::1)
HTTPServerRequest(protocol='http', host='localhost:8888', method='POST', uri='/conda/environments/root/packages/check', version='HTTP/1.1', remote_ip='::1')
Traceback (most recent call last):
File "C:\Users\XXXX\Anaconda3\lib\site-packages\tornado\web.py", line 1590, in _execute
result = method(*self.path_args, **self.path_kwargs)
File "C:\Users\XXXX\Anaconda3\lib\site-packages\tornado\web.py", line 3006, in wrapper
return method(self, *args, **kwargs)
File "C:\Users\XXXX\Anaconda3\lib\site-packages\notebook\base\handlers.py", line 718, in wrapper
return method(self, *args, **kwargs)
File "C:\Users\XXXX\Anaconda3\lib\site-packages\nb_conda\handlers.py", line 140, in post
resp = self.env_manager.check_update(env, packages)
File "C:\Users\XXXX\Anaconda3\lib\site-packages\nb_conda\envmanager.py", line 146, in check_update
links = data['actions'][0].get('LINK', [])
KeyError: 0
[W 11:58:50.794 NotebookApp] Unhandled error
[E 11:58:50.795 NotebookApp] {
"Host": "localhost:8888",
"Connection": "keep-alive",
"Content-Length": "0",
"Accept": "application/json, text/javascript, /; q=0.01",
"Origin": "http://localhost:8888",
"X-Requested-With": "XMLHttpRequest",
"X-Xsrftoken": "2|20b5d5e9|28dbc531c52abf9ebb32ffdf4132ce1e|1542549654",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36",
"Referer": "http://localhost:8888/tree",
"Accept-Encoding": "gzip, deflate, br",
"Accept-Language": "fr,en-US;q=0.9,en;q=0.8",
"Cookie": "_xsrf=2|20b5d5e9|28dbc531c52abf9ebb32ffdf4132ce1e|1542549654; username-localhost-8888="2|1:0|10:1546167396|23:username-localhost-8888|44:MzQyYzI0OGI0MGQyNDVmNGJjMThkMWRhMjFmOGY2ZDI=|822be445c490782ed16760edf38b909e8ecc548feb92458149cb27a86387c945""
}
[E 11:58:50.796 NotebookApp] 500 POST /conda/environments/root/packages/check (::1) 41877.54ms referer=http://localhost:8888/tree

Source Activate Not Executing Prior to Conda Kernel Spawn

Does the activate.sh scrip source in prior to launching a ipython kernel from a conda environment when using nb_conda? We are unable to get our custom hooks that are run inside the activate.sh script to fire when changing to a kernel that is enabled using nb_conda.

2nd miniconda install broken jupyter nb_conda

My research lab and I use a centralized install of miniconda (not installed via root). We've been using conda <v4.4 due to issues with installing certain software for conda >=4.4. In order to start the transition to >4.4, I created a 2nd centralized install of miniconda. Installing this 2nd version of conda seems to have broken nb_conda for all of our Jupyter notebooks. For creating new notebooks, we now only have two options: "Python 3" or "R". Previously, we could select from ~15 different conda environments. When I click on the "conda" table in Jupyter, I get an error, and this is reported on the command line:

[E 13:43:46.719 NotebookApp] 500 GET /conda/packages/available?_=1519649013685 (127.0.0.1) 44.97ms referer=http://127.0.0.1:9705/tree?
Traceback (most recent call last):
  File "/ebio/abt3_projects/software/miniconda3/lib/python3.6/site-packages/conda/exceptions.py", line 640, in conda_exception_handler
    return_value = func(*args, **kwargs)
  File "/ebio/abt3_projects/software/miniconda3/lib/python3.6/site-packages/conda/cli/main.py", line 103, in _main
    from ..base.context import context
  File "/ebio/abt3_projects/software/miniconda3/lib/python3.6/site-packages/conda/base/context.py", line 771, in <module>
    context = Context(SEARCH_PATH, APP_NAME, None)
  File "/ebio/abt3_projects/software/miniconda3/lib/python3.6/site-packages/conda/common/configuration.py", line 727, in __init__
    self._set_search_path(search_path)
  File "/ebio/abt3_projects/software/miniconda3/lib/python3.6/site-packages/conda/common/configuration.py", line 745, in _set_search_path
    self._set_raw_data(load_file_configs(search_path))
  File "/ebio/abt3_projects/software/miniconda3/lib/python3.6/site-packages/conda/common/configuration.py", line 364, in load_file_configs
    expanded_paths = tuple(expand(path) for path in search_path)
  File "/ebio/abt3_projects/software/miniconda3/lib/python3.6/site-packages/conda/common/configuration.py", line 364, in <genexpr>
    expanded_paths = tuple(expand(path) for path in search_path)
  File "/ebio/abt3_projects/software/miniconda3/lib/python3.6/site-packages/conda/common/path.py", line 247, in expand
    return abspath(expanduser(expandvars(path)))
  File "/ebio/abt3_projects/software/miniconda3/lib/python3.6/posixpath.py", line 374, in abspath
    cwd = os.getcwd()
FileNotFoundError: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/ebio/abt3_projects/software/miniconda3/bin/conda", line 11, in <module>
    sys.exit(main())
  File "/ebio/abt3_projects/software/miniconda3/lib/python3.6/site-packages/conda/cli/main.py", line 182, in main
    return conda_exception_handler(_main, *args)
  File "/ebio/abt3_projects/software/miniconda3/lib/python3.6/site-packages/conda/exceptions.py", line 644, in conda_exception_handler
    return handle_exception(e)
  File "/ebio/abt3_projects/software/miniconda3/lib/python3.6/site-packages/conda/exceptions.py", line 634, in handle_exception
    print_unexpected_error_message(e)
  File "/ebio/abt3_projects/software/miniconda3/lib/python3.6/site-packages/conda/exceptions.py", line 579, in print_unexpected_error_message
    from .base.context import context
  File "/ebio/abt3_projects/software/miniconda3/lib/python3.6/site-packages/conda/base/context.py", line 771, in <module>
    context = Context(SEARCH_PATH, APP_NAME, None)
  File "/ebio/abt3_projects/software/miniconda3/lib/python3.6/site-packages/conda/common/configuration.py", line 727, in __init__
    self._set_search_path(search_path)
  File "/ebio/abt3_projects/software/miniconda3/lib/python3.6/site-packages/conda/common/configuration.py", line 745, in _set_search_path
    self._set_raw_data(load_file_configs(search_path))
  File "/ebio/abt3_projects/software/miniconda3/lib/python3.6/site-packages/conda/common/configuration.py", line 364, in load_file_configs
    expanded_paths = tuple(expand(path) for path in search_path)
  File "/ebio/abt3_projects/software/miniconda3/lib/python3.6/site-packages/conda/common/configuration.py", line 364, in <genexpr>
    expanded_paths = tuple(expand(path) for path in search_path)
  File "/ebio/abt3_projects/software/miniconda3/lib/python3.6/site-packages/conda/common/path.py", line 247, in expand
    return abspath(expanduser(expandvars(path)))
  File "/ebio/abt3_projects/software/miniconda3/lib/python3.6/posixpath.py", line 374, in abspath
    cwd = os.getcwd()
FileNotFoundError: [Errno 2] No such file or directory
[E 13:45:08.273 NotebookApp] [nb_conda_kernels] couldn't call conda:

Why did a 2nd conda install affect nb_conda? Isn't everything contained in the conda install directory? Any ideas on how I revert back? Our whole research group of ~20 people now do not have access to the conda environments in Jupyter.

Error during installation of packages

nb_conda 2.2.1
During installation of the package to env outputs "Internal server error" and stacktrace:
screenshot from 2018-02-09 19-34-36

[D 17:34:07.116 NotebookApp] [nb_conda] command: ['conda', 'install', '-y', '-q', '--json', '-n', 'root', '_license']
--skipped--
[D 17:34:15.545 NotebookApp] [nb_conda] ...
[W 17:34:15.545 NotebookApp] [nb_conda] JSON parse fail:
Extra data: line 2 column 1 (char 73)
[E 17:34:15.546 NotebookApp] Uncaught exception POST /conda/environments/root/packages/install (172.17.0.1)
HTTPServerRequest(protocol='http', host='0.0.0.0:8000', method='POST', uri='/conda/environments/root/packages/install', version='HTTP/1.1', remote_ip='172.17.0.1', headers={'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:58.0) Gecko/20100101 Firefox/58.0', 'Accept': 'application/json, text/javascript, /; q=0.01', 'Dnt': '1', 'Referer': 'http://0.0.0.0:8000/tree', 'X-Requested-With': 'XMLHttpRequest', 'Content-Length': '23', 'Cookie': '_xsrf=2|6040c158|5a3a5c8ddd7a44ac49ee58f268ab3254|1518191782; username-0-0-0-0-8000="2|1:0|10:1518197622|21:username-0-0-0-0-8000|44:ZDYxMGU4OWUwOGQzNGY5NWJhM2VlNjNiOWJjNzBmN2M=|2a1244bbe538c07c0e4d9478c4ebbf1b9a3f840383405c3738b06a8cbdf76a0a"', 'Accept-Encoding': 'gzip, deflate', 'Accept-Language': 'en-US,en;q=0.7,uk;q=0.3', 'Host': '0.0.0.0:8000', 'X-Xsrftoken': '2|6040c158|5a3a5c8ddd7a44ac49ee58f268ab3254|1518191782', 'Connection': 'keep-alive', 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'})
Traceback (most recent call last):
File "/opt/conda/lib/python3.5/site-packages/tornado/web.py", line 1509, in _execute
result = method(*self.path_args, **self.path_kwargs)
File "/opt/conda/lib/python3.5/site-packages/tornado/web.py", line 2897, in wrapper
return method(self, *args, **kwargs)
File "/opt/conda/lib/python3.5/site-packages/notebook/base/handlers.py", line 670, in wrapper
return method(self, *args, **kwargs)
File "/opt/conda/lib/python3.5/site-packages/nb_conda/handlers.py", line 136, in post
resp = self.env_manager.install_packages(env, packages)
File "/opt/conda/lib/python3.5/site-packages/nb_conda/envmanager.py", line 160, in install_packages
return self.clean_conda_json(output)
File "/opt/conda/lib/python3.5/site-packages/nb_conda/envmanager.py", line 101, in clean_conda_json
lines = [line for line in lines if re.match(JSONISH_RE)]
File "/opt/conda/lib/python3.5/site-packages/nb_conda/envmanager.py", line 101, in
lines = [line for line in lines if re.match(JSONISH_RE)]
TypeError: match() missing 1 required positional argument: 'string'
[W 17:34:15.550 NotebookApp] Unhandled error
[E 17:34:15.551 NotebookApp] {
"User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:58.0) Gecko/20100101 Firefox/58.0",
"Accept": "application/json, text/javascript, /; q=0.01",
"Dnt": "1",
"Referer": "http://0.0.0.0:8000/tree",
"X-Requested-With": "XMLHttpRequest",
"Content-Length": "23",
"Cookie": "_xsrf=2|6040c158|5a3a5c8ddd7a44ac49ee58f268ab3254|1518191782; username-0-0-0-0-8000="2|1:0|10:1518197622|21:username-0-0-0-0-8000|44:ZDYxMGU4OWUwOGQzNGY5NWJhM2VlNjNiOWJjNzBmN2M=|2a1244bbe538c07c0e4d9478c4ebbf1b9a3f840383405c3738b06a8cbdf76a0a"",
"Accept-Encoding": "gzip, deflate",
"Accept-Language": "en-US,en;q=0.7,uk;q=0.3",
"Host": "0.0.0.0:8000",
"X-Xsrftoken": "2|6040c158|5a3a5c8ddd7a44ac49ee58f268ab3254|1518191782",
"Connection": "keep-alive",
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
}
[E 17:34:15.551 NotebookApp] 500 POST /conda/environments/root/packages/install (172.17.0.1) 8436.62ms referer=http://0.0.0.0:8000/tree

To reproduce - run jupyter-notebook with debug, in conda tab chose environment, chose new package, click icon to install.
Note that fixing re.match in envmanager.py#L101 doesn't fixes the issue - I've got other stacktrace trying to create new env after that, as well as "error: True" in the end for the installation of packages.

unhandled AttributeError on listing current env

When trying to use the Kernel->Conda Packages menu entry provided by nb_conda, I'm encountering the following unhandled exception:

[E 17:32:30.477 NotebookApp] Unhandled error in API request
    Traceback (most recent call last):
      File "/sarc/spa/users/tsnyder/.conda/envs/cat-1/lib/python3.5/site-packages/notebook/base/handlers.py", line 457, in wrapper
        result = yield gen.maybe_future(method(self, *args, **kwargs))
      File "/sarc/spa/users/tsnyder/.conda/envs/cat-1/lib/python3.5/site-packages/nb_conda/handlers.py", line 62, in get
        self.finish(json.dumps(self.env_manager.env_packages(env)))
      File "/sarc/spa/users/tsnyder/.conda/envs/cat-1/lib/python3.5/site-packages/nb_conda/envmanager.py", line 124, in env_packages
        "packages": [pkg_info(package) for package in data]
      File "/sarc/spa/users/tsnyder/.conda/envs/cat-1/lib/python3.5/site-packages/nb_conda/envmanager.py", line 124, in <listcomp>
        "packages": [pkg_info(package) for package in data]
      File "/sarc/spa/users/tsnyder/.conda/envs/cat-1/lib/python3.5/site-packages/nb_conda/envmanager.py", line 16, in pkg_info
        name, version, build = s.rsplit('-', 2)
    AttributeError: 'dict' object has no attribute 'rsplit'

cat-1.yaml.txt is the output of conda env export for my environment. Before filing this ticket, I also had @groutr repro the behavior.

Jupyter isn't showing all enviroments

Hi, I'm having this annoying problem.

If I list all the current environments I get:

alejandroalvarez@PMITN010321:~$ conda info --envs
# conda environments:
#
imgqlty                  /home/alejandroalvarez/anaconda3/envs/imgqlty
opencv                   /home/alejandroalvarez/anaconda3/envs/opencv
root                  *  /home/alejandroalvarez/anaconda3

But then, after launching jupyter, it doesn't show the opencv environment!

alejandroalvarez@PMITN010321:~$ jupyter notebook
[I 17:35:20.162 NotebookApp] [nb_conda_kernels] enabled, 3 kernels found
[I 17:35:20.534 NotebookApp] The port 8888 is already in use, trying another port.
[I 17:35:20.625 NotebookApp] [nb_anacondacloud] enabled
[I 17:35:20.652 NotebookApp] [nb_conda] enabled
[I 17:35:20.693 NotebookApp] ✓ nbpresent HTML export ENABLED
[W 17:35:20.693 NotebookApp] ✗ nbpresent PDF export DISABLED: No module named 'nbbrowserpdf'
[I 17:35:20.695 NotebookApp] Serving notebooks from local directory: /home/alejandroalvarez
[I 17:35:20.695 NotebookApp] 0 active kernels 
[I 17:35:20.695 NotebookApp] The Jupyter Notebook is running at: http://localhost:8889/?token=bd6abbee010d501676c4bab364985aa52fd38d7c68b16298
[I 17:35:20.695 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 17:35:20.697 NotebookApp] 
    
    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        http://localhost:8889/?token=bd6abbee010d501676c4bab364985aa52fd38d7c68b16298
[25343:25378:0907/173521.029754:ERROR:browser_gpu_channel_host_factory.cc(103)] Failed to launch GPU process.
Created new window in existing browser session.
[I 17:35:21.041 NotebookApp] Accepting one-time-token-authenticated connection from 127.0.0.1

screenshot from 2017-09-07 17-38-36

Can you give me a hand with this?

pre-unlink and post-link failures during package install

pre-unlink failed during package install

conda install nb_conda
Fetching package metadata .............
Solving package specifications: .

Package plan for installation in environment /opt/anaconda:

The following NEW packages will be INSTALLED:

    _nb_ext_conf:     0.4.0-py27_1
    nbpresent:        3.0.2-py27h73ae17d_1

The following packages will be UPDATED:

    nb_conda:         0.1.4-py27_0           anaconda-nb-extensions --> 2.2.1-py27h9a0a3a7_0
    nb_conda_kernels: 0.1.2-py27_17_g7aeb8c5 anaconda-nb-extensions --> 2.1.0-py27_0

Proceed ([y]/n)?

nbpresent-3.0. 100% |###################################################################################| Time: 0:00:00   5.50 MB/s
nb_conda-2.2.1 100% |###################################################################################| Time: 0:00:00  26.32 MB/s
WARNING conda.core.link:run_script(516): pre-unlink script failed for package anaconda-nb-extensions::nb_conda_kernels-0.1.2-py27_17_g7aeb8c5
consider notifying the package maintainer
+ /opt/anaconda/bin/jupyter-nbextension enable nbpresent --py --sys-prefix
Enabling notebook extension nbpresent/js/nbpresent.min...
      - Validating: OK
+ /opt/anaconda/bin/jupyter-serverextension enable nbpresent --py --sys-prefix
Enabling: nbpresent
- Writing config: /opt/anaconda/etc/jupyter
    - Validating...
      nbpresent  OK

+ /opt/anaconda/bin/jupyter-nbextension enable nb_conda --py --sys-prefix
Enabling notebook extension nb_conda/main...
      - Validating: OK
Enabling tree extension nb_conda/tree...
      - Validating: OK
+ /opt/anaconda/bin/jupyter-serverextension enable nb_conda --py --sys-prefix
Enabling: nb_conda
- Writing config: /opt/anaconda/etc/jupyter
    - Validating...
      nb_conda  OK

conda info
Current conda install:

               platform : osx-64
          conda version : 4.3.27
       conda is private : False
      conda-env version : 4.3.27
    conda-build version : 2.1.7
         python version : 2.7.11.final.0
       requests version : 2.13.0
       root environment : /opt/anaconda  (writable)
    default environment : /opt/anaconda
       envs directories : /opt/anaconda/envs
                          /Users/jhull/.conda/envs
          package cache : /opt/anaconda/pkgs
                          /Users/jhull/.conda/pkgs
           channel URLs : https://repo.continuum.io/pkgs/main/osx-64
                          https://repo.continuum.io/pkgs/main/noarch
                          https://repo.continuum.io/pkgs/free/osx-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/osx-64
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/osx-64
                          https://repo.continuum.io/pkgs/pro/noarch
                          https://conda.anaconda.org/anaconda/osx-64
                          https://conda.anaconda.org/anaconda/noarch
            config file : /Users/jhull/.condarc
             netrc file : None
           offline mode : False
             user-agent : conda/4.3.27 requests/2.13.0 CPython/2.7.11 Darwin/16.7.0 OSX/10.12.6
                UID:GID : 502:20

Also, the nb_conda package failed to install when it was part of an anaconda install built with Constructor 2.0.0. This failure causes the entire anaconda install to fail.

installing: nb_conda-2.2.1-py27h9a0a3a7_0 ...
Error: post-link failed for: nb_conda-2.2.1-py27h9a0a3a7_0

Creating new R environments displays an error, but conda is still working behind-the-scenes

Hello!

We are working on upgrading our JupyterHub instance to use version 0.9.1 and Conda version 4.5.8.

The issue we are seeing now relates to creating a new R environment through the Conda tab while using JupyterHub. Conda and R historically seems to take a LONG time to create a new environment because Conda has to solve all of the package specifications.

When creating a new environment, it throws and error:
image

BUT, if you check running processes on the host conda is still working and eventually creates the environment.

image

Additionally, similar behavior is observed when cloning an environment through the UI.

Incomplete regex for pulling out env name of nb_conda_kernels

This line:

 m = /\[(\w+)\]/.exec(kernel_name);

has two things going on:

  • it's a naked assignment, which gets hoisted all the way to the global scope, clobbering any other m variable.

    • I don't know if any libraries use that, but they could.
    • possible fixes:
      • fix with var
      • fix better with use strict at top of defined function
        • fix process by adding a linting step
  • the regex uses \w,

    any alphanumeric character from the basic Latin alphabet, including the underscore. Equivalent to [A-Za-z0-9_].

    but conda can pretty much use anything in an env name, including square brackets and spaces (if you hate yourself... though things start breaking IMMEDIATELY, then)... but we can only do so much here

    • fix by accepting everything but a trailing square bracket: \[(.+)\]$

I'll work up a [wip].

What custom envs and pkgs paths does nb_conda support?

  • envs/pkgs paths set in ~/.condarc?
  • envs/pkgs paths set in file pointed to by $CONDARC?
  • envs/pkgs paths set using $CONDA_ENVS_DIRS / $CONDA_ENVS_DIRS?
  • All of the above?

I ask as I can create envs in a Jupyter terminal under a location specified in ~/.condarc but nb_conda doesn't then show them, even after refreshing the nb_conda pane. For info, I'm using nb_conda 2.2.0 and conda 4.3.17 with JupyterHub 0.7.2.

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.