jupyter / jupyter/notebook

Fails to load dll when in notebook, but not in ipython

Open
#4,569 10 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
13.3k
Forks
5.8k
Avg merge
6d 11h
Merged PRs (30d)
7

Description

Today, on my windows 10 laptop, I installed jupyterlab / classical notebook in one conda environment and a kernel ("sge_usage") in another conda environment. I registered this kernel environment with

```
conda activate sge_usage
conda install ipykernel
ipython kernel install --user --name sge_usage
```

While `sge_usage` is activated, if import numpy in an ipython session, it works:

```
>ipython
Python 3.7.3 (default, Mar 27 2019, 17:13:21) [MSC v.1915 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 7.4.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import numpy as np

In [2]:
```

Now, in a notebook, either in the classical one or in the jupyterlab one, with `sge_usage` kernel selected, if I try to import numpy here is the result:

```
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
in
----> 1 import numpy as np

D:\conda\envs\sge_usage\lib\site-packages\numpy\__init__.py in
138
139 # Allow distributors to run custom init code
--> 140 from . import _distributor_init
141
142 from . import core

D:\conda\envs\sge_usage\lib\site-packages\numpy\_distributor_init.py in
32
33 with RTLD_for_MKL():
---> 34 from . import _mklinit
35
36 del RTLD_for_MKL

ImportError: DLL load failed: The specified module could not be found
```

Note that in the traceback, you can see that the correct kernel is called. I am not sure that this is a notebook issue. That could be also a change in the the way anaconda does its packaging?

### Version information

In jupyterlab environment:
```
>conda list
# packages in environment at D:\conda\envs\jupyter-py3:
#
# Name Version Build Channel
attrs 19.1.0 py37_1 defaults
backcall 0.1.0 py37_0 defaults
bleach 3.1.0 py37_0 defaults
ca-certificates 2019.1.23 0 defaults
certifi 2019.3.9 py37_0 defaults
colorama 0.4.1 py37_0 defaults
decorator 4.4.0 py37_1 defaults
defusedxml 0.5.0 py37_1 defaults
entrypoints 0.3 py37_0 defaults
ipykernel 5.1.0 py37h39e3cac_0 defaults
ipython 7.4.0 py37h39e3cac_0 defaults
ipython_genutils 0.2.0 py37_0 defaults
jedi 0.13.3 py37_0 defaults
jinja2 2.10.1 py37_0 defaults
jsonschema 3.0.1 py37_0 defaults
jupyter_client 5.2.4 py37_0 defaults
jupyter_core 4.4.0 py37_0 defaults
jupyterlab 0.35.4 py37hf63ae98_0 defaults
jupyterlab_server 0.2.0 py37_0 defaults
libsodium 1.0.16 h9d3ae62_0 defaults
m2w64-gcc-libgfortran 5.3.0 6 defaults
m2w64-gcc-libs 5.3.0 7 defaults
m2w64-gcc-libs-core 5.3.0 7 defaults
m2w64-gmp 6.1.0 2 defaults
m2w64-libwinpthread-git 5.0.0.4634.697f757 2 defaults
markupsafe 1.1.1 py37he774522_0 defaults
mistune 0.8.4 py37he774522_0 defaults
msys2-conda-epoch 20160418 1 defaults
nbconvert 5.4.1 py37_3 defaults
nbformat 4.4.0 py37_0 defaults
notebook 5.7.8 py37_0 defaults
openssl 1.1.1b he774522_1 defaults
pandoc 2.2.3.2 0 defaults
pandocfilters 1.4.2 py37_1 defaults
parso 0.3.4 py37_0 defaults
pickleshare 0.7.5 py37_0 defaults
pip 19.0.3 py37_0 defaults
prometheus_client 0.6.0 py37_0 defaults
prompt_toolkit 2.0.9 py37_0 defaults
pygments 2.3.1 py37_0 defaults
pyrsistent 0.14.11 py37he774522_0 defaults
python 3.7.3 h8c8aaf0_0 defaults
python-dateutil 2.8.0 py37_0 defaults
pywinpty 0.5.5 py37_1000 defaults
pyzmq 18.0.0 py37ha925a31_0 defaults
send2trash 1.5.0 py37_0 defaults
setuptools 41.0.0 py37_0 defaults
six 1.12.0 py37_0 defaults
sqlite 3.27.2 he774522_0 defaults
terminado 0.8.1 py37_1 defaults
testpath 0.4.2 py37_0 defaults
tornado 6.0.2 py37he774522_0 defaults
traitlets 4.3.2 py37_0 defaults
vc 14.1 h0510ff6_4 defaults
vs2015_runtime 14.15.26706 h3a45250_0 defaults
wcwidth 0.1.7 py37_0 defaults
webencodings 0.5.1 py37_1 defaults
wheel 0.33.1 py37_0 defaults
wincertstore 0.2 py37_0 defaults
winpty 0.4.3 4 defaults
zeromq 4.3.1 h33f27b4_3 defaults
```

In `sge_usage` environment:
```
>conda list
# packages in environment at D:\conda\envs\sge_usage:
#
# Name Version Build Channel
backcall 0.1.0 py37_0 defaults
blas 1.0 mkl defaults
ca-certificates 2019.1.23 0 defaults
certifi 2019.3.9 py37_0 defaults
colorama 0.4.1 py37_0 defaults
decorator 4.4.0 py37_1 defaults
icc_rt 2019.0.0 h0cc432a_1 defaults
intel-openmp 2019.3 203 defaults
ipykernel 5.1.0 py37h39e3cac_0 defaults
ipython 7.4.0 py37h39e3cac_0 defaults
ipython_genutils 0.2.0 py37_0 defaults
jedi 0.13.3 py37_0 defaults
jupyter_client 5.2.4 py37_0 defaults
jupyter_core 4.4.0 py37_0 defaults
libsodium 1.0.16 h9d3ae62_0 defaults
mkl 2019.3 203 defaults
mkl_fft 1.0.10 py37h14836fe_0 defaults
mkl_random 1.0.2 py37h343c172_0 defaults
numpy 1.16.2 py37h19fb1c0_0 defaults
numpy-base 1.16.2 py37hc3f5095_0 defaults
openssl 1.1.1b he774522_1 defaults
pandas 0.24.2 py37ha925a31_0 defaults
parso 0.3.4 py37_0 defaults
pickleshare 0.7.5 py37_0 defaults
pip 19.0.3 py37_0 defaults
prompt_toolkit 2.0.9 py37_0 defaults
pygments 2.3.1 py37_0 defaults
python 3.7.3 h8c8aaf0_0 defaults
python-dateutil 2.8.0 py37_0 defaults
pytz 2018.9 py37_0 defaults
pyzmq 18.0.0 py37ha925a31_0 defaults
setuptools 41.0.0 py37_0 defaults
six 1.12.0 py37_0 defaults
sqlite 3.27.2 he774522_0 defaults
tornado 6.0.2 py37he774522_0 defaults
traitlets 4.3.2 py37_0 defaults
vc 14.1 h0510ff6_4 defaults
vs2015_runtime 14.15.26706 h3a45250_0 defaults
wcwidth 0.1.7 py37_0 defaults
wheel 0.33.1 py37_0 defaults
wincertstore 0.2 py37_0 defaults
zeromq 4.3.1 h33f27b4_3 defaults
```

Contributor guide

Open the contributing guide

Research direction

Begin by reproducing the Windows 10 setup with separate jupyter and sge_usage conda environments, using the reported kernel registration commands. Compare numpy imports in IPython and the notebook's sge_usage kernel, starting from the reported _mklinit DLL error. Done means numpy imports successfully in the notebook kernel.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, numpy, python
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.