jupyterlab / jupyterlab

JupyterLab computational environment.
https://jupyterlab.readthedocs.io/
Other
14.16k stars 3.38k forks source link

jupyter has the path to the wrong envirnoment even though it loads from the correct path #10468

Closed mnky9800n closed 3 years ago

mnky9800n commented 3 years ago

Description

This is related to this stackoverflow post:

https://stackoverflow.com/questions/68085993/conda-environment-path-is-different-for-ipython-versus-jupyter

Basically, I create a new environment with conda, I conda install jupyter and jupyterlab. I run the jupyter lab server. This is loaded from the newly created environment. When I open a notebook in the browser, it says the path is to a different environment. This quickly leads to trouble since none of the installed libraries from conda end up being accessible to the notebook since it sees a different environment as the path.

Reproduce

  1. conda create -n test python=3.8
  2. conda install jupyter
  3. conda install jupyterlab
  4. jupyter lab
  5. open browser and create a notebook whose path is different from the jupyter server
  6. import sys
  7. sys.path

Expected behavior

The path of a notebook should be the same as the path of the server

Context

Troubleshoot Output
$PATH:
    /home/john/anaconda3/envs/test/bin
    /home/john/gems/bin
    /home/john/anaconda3/bin
    /home/john/anaconda3/condabin
    /usr/local/sbin
    /usr/local/bin
    /usr/sbin
    /usr/bin
    /sbin
    /bin
    /usr/games
    /usr/local/games
    /snap/bin
    /opt/mssql-tools/bin
    /opt/mssql-tools/bin

sys.path:
    /home/john/anaconda3/envs/test/bin
    /home/john/anaconda3/envs/test/lib/python38.zip
    /home/john/anaconda3/envs/test/lib/python3.8
    /home/john/anaconda3/envs/test/lib/python3.8/lib-dynload
    /home/john/anaconda3/envs/test/lib/python3.8/site-packages

sys.executable:
    /home/john/anaconda3/envs/test/bin/python

sys.version:
    3.8.10 | packaged by conda-forge | (default, May 11 2021, 07:01:05) 
    [GCC 9.3.0]

platform.platform():
    Linux-4.15.0-36-generic-x86_64-with-glibc2.10

which -a jupyter:
    /home/john/anaconda3/envs/test/bin/jupyter
    /home/john/anaconda3/bin/jupyter
    /usr/bin/jupyter

pip list:
    Package                       Version
    ----------------------------- -------------------
    anyio                         3.2.0
    argon2-cffi                   20.1.0
    async-generator               1.10
    attrs                         21.2.0
    Babel                         2.9.1
    backcall                      0.2.0
    backports.functools-lru-cache 1.6.4
    bleach                        3.3.0
    brotlipy                      0.7.0
    certifi                       2021.5.30
    cffi                          1.14.5
    chardet                       4.0.0
    cryptography                  3.4.7
    decorator                     5.0.9
    defusedxml                    0.7.1
    entrypoints                   0.3
    idna                          2.10
    importlib-metadata            4.5.0
    ipykernel                     5.5.5
    ipython                       7.24.1
    ipython-genutils              0.2.0
    ipywidgets                    7.6.3
    jedi                          0.18.0
    Jinja2                        3.0.1
    json5                         0.9.5
    jsonschema                    3.2.0
    jupyter                       1.0.0
    jupyter-client                6.1.12
    jupyter-console               6.4.0
    jupyter-core                  4.7.1
    jupyter-server                1.8.0
    jupyterlab                    3.0.16
    jupyterlab-pygments           0.1.2
    jupyterlab-server             2.6.0
    jupyterlab-widgets            1.0.0
    MarkupSafe                    2.0.1
    matplotlib-inline             0.1.2
    mistune                       0.8.4
    nbclassic                     0.3.1
    nbclient                      0.5.3
    nbconvert                     6.0.7
    nbformat                      5.1.3
    nest-asyncio                  1.5.1
    notebook                      6.4.0
    packaging                     20.9
    pandocfilters                 1.4.2
    parso                         0.8.2
    pexpect                       4.8.0
    pickleshare                   0.7.5
    pip                           21.1.2
    prometheus-client             0.11.0
    prompt-toolkit                3.0.19
    ptyprocess                    0.7.0
    pycparser                     2.20
    Pygments                      2.9.0
    pyOpenSSL                     20.0.1
    pyparsing                     2.4.7
    PyQt5                         5.12.3
    PyQt5-sip                     4.19.18
    PyQtChart                     5.12
    PyQtWebEngine                 5.12.1
    pyrsistent                    0.17.3
    PySocks                       1.7.1
    python-dateutil               2.8.1
    pytz                          2021.1
    pyzmq                         22.1.0
    qtconsole                     5.1.0
    QtPy                          1.9.0
    requests                      2.25.1
    Send2Trash                    1.7.1
    setuptools                    49.6.0.post20210108
    six                           1.16.0
    sniffio                       1.2.0
    terminado                     0.10.1
    testpath                      0.5.0
    tornado                       6.1
    traitlets                     5.0.5
    urllib3                       1.26.5
    wcwidth                       0.2.5
    webencodings                  0.5.1
    websocket-client              0.57.0
    wheel                         0.36.2
    widgetsnbextension            3.5.1
    zipp                          3.4.1

conda list:
    # packages in environment at /home/john/anaconda3/envs/test:
    #
    # Name                    Version                   Build  Channel
    _libgcc_mutex             0.1                 conda_forge    conda-forge
    _openmp_mutex             4.5                       1_gnu    conda-forge
    alsa-lib                  1.2.3                h516909a_0    conda-forge
    anyio                     3.2.0            py38h578d9bd_0    conda-forge
    argon2-cffi               20.1.0           py38h497a2fe_2    conda-forge
    async_generator           1.10                       py_0    conda-forge
    attrs                     21.2.0             pyhd8ed1ab_0    conda-forge
    babel                     2.9.1              pyh44b312d_0    conda-forge
    backcall                  0.2.0              pyh9f0ad1d_0    conda-forge
    backports                 1.0                        py_2    conda-forge
    backports.functools_lru_cache 1.6.4              pyhd8ed1ab_0    conda-forge
    bleach                    3.3.0              pyh44b312d_0    conda-forge
    brotlipy                  0.7.0           py38h497a2fe_1001    conda-forge
    ca-certificates           2021.5.30            ha878542_0    conda-forge
    certifi                   2021.5.30        py38h578d9bd_0    conda-forge
    cffi                      1.14.5           py38ha65f79e_0    conda-forge
    chardet                   4.0.0            py38h578d9bd_1    conda-forge
    cryptography              3.4.7            py38ha5dfef3_0    conda-forge
    dbus                      1.13.6               h48d8840_2    conda-forge
    decorator                 5.0.9              pyhd8ed1ab_0    conda-forge
    defusedxml                0.7.1              pyhd8ed1ab_0    conda-forge
    entrypoints               0.3             pyhd8ed1ab_1003    conda-forge
    expat                     2.4.1                h9c3ff4c_0    conda-forge
    fontconfig                2.13.1            hba837de_1005    conda-forge
    freetype                  2.10.4               h0708190_1    conda-forge
    gettext                   0.19.8.1          h0b5b191_1005    conda-forge
    glib                      2.68.3               h9c3ff4c_0    conda-forge
    glib-tools                2.68.3               h9c3ff4c_0    conda-forge
    gst-plugins-base          1.18.4               hf529b03_2    conda-forge
    gstreamer                 1.18.4               h76c114f_2    conda-forge
    icu                       68.1                 h58526e2_0    conda-forge
    idna                      2.10               pyh9f0ad1d_0    conda-forge
    importlib-metadata        4.5.0            py38h578d9bd_0    conda-forge
    ipykernel                 5.5.5            py38hd0cf306_0    conda-forge
    ipython                   7.24.1           py38hd0cf306_0    conda-forge
    ipython_genutils          0.2.0                      py_1    conda-forge
    ipywidgets                7.6.3              pyhd3deb0d_0    conda-forge
    jedi                      0.18.0           py38h578d9bd_2    conda-forge
    jinja2                    3.0.1              pyhd8ed1ab_0    conda-forge
    jpeg                      9d                   h36c2ea0_0    conda-forge
    json5                     0.9.5              pyh9f0ad1d_0    conda-forge
    jsonschema                3.2.0              pyhd8ed1ab_3    conda-forge
    jupyter                   1.0.0            py38h578d9bd_6    conda-forge
    jupyter_client            6.1.12             pyhd8ed1ab_0    conda-forge
    jupyter_console           6.4.0              pyhd8ed1ab_0    conda-forge
    jupyter_core              4.7.1            py38h578d9bd_0    conda-forge
    jupyter_server            1.8.0              pyhd8ed1ab_0    conda-forge
    jupyterlab                3.0.16             pyhd8ed1ab_0    conda-forge
    jupyterlab_pygments       0.1.2              pyh9f0ad1d_0    conda-forge
    jupyterlab_server         2.6.0              pyhd8ed1ab_0    conda-forge
    jupyterlab_widgets        1.0.0              pyhd8ed1ab_1    conda-forge
    krb5                      1.19.1               hcc1bbae_0    conda-forge
    ld_impl_linux-64          2.35.1               hea4e1c9_2    conda-forge
    libclang                  11.1.0          default_ha53f305_1    conda-forge
    libedit                   3.1.20191231         he28a2e2_2    conda-forge
    libevent                  2.1.10               hcdb4288_3    conda-forge
    libffi                    3.3                  h58526e2_2    conda-forge
    libgcc-ng                 9.3.0               h2828fa1_19    conda-forge
    libglib                   2.68.3               h3e27bee_0    conda-forge
    libgomp                   9.3.0               h2828fa1_19    conda-forge
    libiconv                  1.16                 h516909a_0    conda-forge
    libllvm11                 11.1.0               hf817b99_2    conda-forge
    libogg                    1.3.4                h7f98852_1    conda-forge
    libopus                   1.3.1                h7f98852_1    conda-forge
    libpng                    1.6.37               h21135ba_2    conda-forge
    libpq                     13.3                 hd57d9b9_0    conda-forge
    libsodium                 1.0.18               h36c2ea0_1    conda-forge
    libstdcxx-ng              9.3.0               h6de172a_19    conda-forge
    libuuid                   2.32.1            h7f98852_1000    conda-forge
    libvorbis                 1.3.7                h9c3ff4c_0    conda-forge
    libxcb                    1.13              h7f98852_1003    conda-forge
    libxkbcommon              1.0.3                he3ba5ed_0    conda-forge
    libxml2                   2.9.12               h72842e0_0    conda-forge
    lz4-c                     1.9.3                h9c3ff4c_0    conda-forge
    markupsafe                2.0.1            py38h497a2fe_0    conda-forge
    matplotlib-inline         0.1.2              pyhd8ed1ab_2    conda-forge
    mistune                   0.8.4           py38h497a2fe_1003    conda-forge
    mysql-common              8.0.25               ha770c72_2    conda-forge
    mysql-libs                8.0.25               hfa10184_2    conda-forge
    nbclassic                 0.3.1              pyhd8ed1ab_1    conda-forge
    nbclient                  0.5.3              pyhd8ed1ab_0    conda-forge
    nbconvert                 6.0.7            py38h578d9bd_3    conda-forge
    nbformat                  5.1.3              pyhd8ed1ab_0    conda-forge
    ncurses                   6.2                  h58526e2_4    conda-forge
    nest-asyncio              1.5.1              pyhd8ed1ab_0    conda-forge
    notebook                  6.4.0              pyha770c72_0    conda-forge
    nspr                      4.30                 h9c3ff4c_0    conda-forge
    nss                       3.67                 hb5efdd6_0    conda-forge
    openssl                   1.1.1k               h7f98852_0    conda-forge
    packaging                 20.9               pyh44b312d_0    conda-forge
    pandoc                    2.14.0.2             h7f98852_0    conda-forge
    pandocfilters             1.4.2                      py_1    conda-forge
    parso                     0.8.2              pyhd8ed1ab_0    conda-forge
    pcre                      8.45                 h9c3ff4c_0    conda-forge
    pexpect                   4.8.0              pyh9f0ad1d_2    conda-forge
    pickleshare               0.7.5                   py_1003    conda-forge
    pip                       21.1.2             pyhd8ed1ab_0    conda-forge
    prometheus_client         0.11.0             pyhd8ed1ab_0    conda-forge
    prompt-toolkit            3.0.19             pyha770c72_0    conda-forge
    prompt_toolkit            3.0.19               hd8ed1ab_0    conda-forge
    pthread-stubs             0.4               h36c2ea0_1001    conda-forge
    ptyprocess                0.7.0              pyhd3deb0d_0    conda-forge
    pycparser                 2.20               pyh9f0ad1d_2    conda-forge
    pygments                  2.9.0              pyhd8ed1ab_0    conda-forge
    pyopenssl                 20.0.1             pyhd8ed1ab_0    conda-forge
    pyparsing                 2.4.7              pyh9f0ad1d_0    conda-forge
    pyqt                      5.12.3           py38h578d9bd_7    conda-forge
    pyqt-impl                 5.12.3           py38h7400c14_7    conda-forge
    pyqt5-sip                 4.19.18          py38h709712a_7    conda-forge
    pyqtchart                 5.12             py38h7400c14_7    conda-forge
    pyqtwebengine             5.12.1           py38h7400c14_7    conda-forge
    pyrsistent                0.17.3           py38h497a2fe_2    conda-forge
    pysocks                   1.7.1            py38h578d9bd_3    conda-forge
    python                    3.8.10          h49503c6_1_cpython    conda-forge
    python-dateutil           2.8.1                      py_0    conda-forge
    python_abi                3.8                      1_cp38    conda-forge
    pytz                      2021.1             pyhd8ed1ab_0    conda-forge
    pyzmq                     22.1.0           py38h2035c66_0    conda-forge
    qt                        5.12.9               hda022c4_4    conda-forge
    qtconsole                 5.1.0              pyhd8ed1ab_0    conda-forge
    qtpy                      1.9.0                      py_0    conda-forge
    readline                  8.1                  h46c0cb4_0    conda-forge
    requests                  2.25.1             pyhd3deb0d_0    conda-forge
    send2trash                1.7.1              pyhd8ed1ab_0    conda-forge
    setuptools                49.6.0           py38h578d9bd_3    conda-forge
    six                       1.16.0             pyh6c4a22f_0    conda-forge
    sniffio                   1.2.0            py38h578d9bd_1    conda-forge
    sqlite                    3.36.0               h9cd32fc_0    conda-forge
    terminado                 0.10.1           py38h578d9bd_0    conda-forge
    testpath                  0.5.0              pyhd8ed1ab_0    conda-forge
    tk                        8.6.10               h21135ba_1    conda-forge
    tornado                   6.1              py38h497a2fe_1    conda-forge
    traitlets                 5.0.5                      py_0    conda-forge
    urllib3                   1.26.5             pyhd8ed1ab_0    conda-forge
    wcwidth                   0.2.5              pyh9f0ad1d_2    conda-forge
    webencodings              0.5.1                      py_1    conda-forge
    websocket-client          0.57.0           py38h578d9bd_4    conda-forge
    wheel                     0.36.2             pyhd3deb0d_0    conda-forge
    widgetsnbextension        3.5.1            py38h578d9bd_4    conda-forge
    xorg-libxau               1.0.9                h7f98852_0    conda-forge
    xorg-libxdmcp             1.1.3                h7f98852_0    conda-forge
    xz                        5.2.5                h516909a_1    conda-forge
    zeromq                    4.3.4                h9c3ff4c_0    conda-forge
    zipp                      3.4.1              pyhd8ed1ab_0    conda-forge
    zlib                      1.2.11            h516909a_1010    conda-forge
    zstd                      1.5.0                ha95c52a_0    conda-forge

conda env:
    name: test
    channels:
      - conda-forge
      - https://repo.anaconda.com/pkgs/main
      - https://repo.anaconda.com/pkgs/free
      - https://repo.anaconda.com/pkgs/r
      - https://repo.anaconda.com/pkgs/pro
    dependencies:
      - _libgcc_mutex=0.1=conda_forge
      - _openmp_mutex=4.5=1_gnu
      - alsa-lib=1.2.3=h516909a_0
      - anyio=3.2.0=py38h578d9bd_0
      - argon2-cffi=20.1.0=py38h497a2fe_2
      - async_generator=1.10=py_0
      - attrs=21.2.0=pyhd8ed1ab_0
      - babel=2.9.1=pyh44b312d_0
      - backcall=0.2.0=pyh9f0ad1d_0
      - backports=1.0=py_2
      - backports.functools_lru_cache=1.6.4=pyhd8ed1ab_0
      - bleach=3.3.0=pyh44b312d_0
      - brotlipy=0.7.0=py38h497a2fe_1001
      - ca-certificates=2021.5.30=ha878542_0
      - certifi=2021.5.30=py38h578d9bd_0
      - cffi=1.14.5=py38ha65f79e_0
      - chardet=4.0.0=py38h578d9bd_1
      - cryptography=3.4.7=py38ha5dfef3_0
      - dbus=1.13.6=h48d8840_2
      - decorator=5.0.9=pyhd8ed1ab_0
      - defusedxml=0.7.1=pyhd8ed1ab_0
      - entrypoints=0.3=pyhd8ed1ab_1003
      - expat=2.4.1=h9c3ff4c_0
      - fontconfig=2.13.1=hba837de_1005
      - freetype=2.10.4=h0708190_1
      - gettext=0.19.8.1=h0b5b191_1005
      - glib=2.68.3=h9c3ff4c_0
      - glib-tools=2.68.3=h9c3ff4c_0
      - gst-plugins-base=1.18.4=hf529b03_2
      - gstreamer=1.18.4=h76c114f_2
      - icu=68.1=h58526e2_0
      - idna=2.10=pyh9f0ad1d_0
      - importlib-metadata=4.5.0=py38h578d9bd_0
      - ipykernel=5.5.5=py38hd0cf306_0
      - ipython=7.24.1=py38hd0cf306_0
      - ipython_genutils=0.2.0=py_1
      - ipywidgets=7.6.3=pyhd3deb0d_0
      - jedi=0.18.0=py38h578d9bd_2
      - jinja2=3.0.1=pyhd8ed1ab_0
      - jpeg=9d=h36c2ea0_0
      - json5=0.9.5=pyh9f0ad1d_0
      - jsonschema=3.2.0=pyhd8ed1ab_3
      - jupyter=1.0.0=py38h578d9bd_6
      - jupyter_client=6.1.12=pyhd8ed1ab_0
      - jupyter_console=6.4.0=pyhd8ed1ab_0
      - jupyter_core=4.7.1=py38h578d9bd_0
      - jupyter_server=1.8.0=pyhd8ed1ab_0
      - jupyterlab=3.0.16=pyhd8ed1ab_0
      - jupyterlab_pygments=0.1.2=pyh9f0ad1d_0
      - jupyterlab_server=2.6.0=pyhd8ed1ab_0
      - jupyterlab_widgets=1.0.0=pyhd8ed1ab_1
      - krb5=1.19.1=hcc1bbae_0
      - ld_impl_linux-64=2.35.1=hea4e1c9_2
      - libclang=11.1.0=default_ha53f305_1
      - libedit=3.1.20191231=he28a2e2_2
      - libevent=2.1.10=hcdb4288_3
      - libffi=3.3=h58526e2_2
      - libgcc-ng=9.3.0=h2828fa1_19
      - libglib=2.68.3=h3e27bee_0
      - libgomp=9.3.0=h2828fa1_19
      - libiconv=1.16=h516909a_0
      - libllvm11=11.1.0=hf817b99_2
      - libogg=1.3.4=h7f98852_1
      - libopus=1.3.1=h7f98852_1
      - libpng=1.6.37=h21135ba_2
      - libpq=13.3=hd57d9b9_0
      - libsodium=1.0.18=h36c2ea0_1
      - libstdcxx-ng=9.3.0=h6de172a_19
      - libuuid=2.32.1=h7f98852_1000
      - libvorbis=1.3.7=h9c3ff4c_0
      - libxcb=1.13=h7f98852_1003
      - libxkbcommon=1.0.3=he3ba5ed_0
      - libxml2=2.9.12=h72842e0_0
      - lz4-c=1.9.3=h9c3ff4c_0
      - markupsafe=2.0.1=py38h497a2fe_0
      - matplotlib-inline=0.1.2=pyhd8ed1ab_2
      - mistune=0.8.4=py38h497a2fe_1003
      - mysql-common=8.0.25=ha770c72_2
      - mysql-libs=8.0.25=hfa10184_2
      - nbclassic=0.3.1=pyhd8ed1ab_1
      - nbclient=0.5.3=pyhd8ed1ab_0
      - nbconvert=6.0.7=py38h578d9bd_3
      - nbformat=5.1.3=pyhd8ed1ab_0
      - ncurses=6.2=h58526e2_4
      - nest-asyncio=1.5.1=pyhd8ed1ab_0
      - notebook=6.4.0=pyha770c72_0
      - nspr=4.30=h9c3ff4c_0
      - nss=3.67=hb5efdd6_0
      - openssl=1.1.1k=h7f98852_0
      - packaging=20.9=pyh44b312d_0
      - pandoc=2.14.0.2=h7f98852_0
      - pandocfilters=1.4.2=py_1
      - parso=0.8.2=pyhd8ed1ab_0
      - pcre=8.45=h9c3ff4c_0
      - pexpect=4.8.0=pyh9f0ad1d_2
      - pickleshare=0.7.5=py_1003
      - pip=21.1.2=pyhd8ed1ab_0
      - prometheus_client=0.11.0=pyhd8ed1ab_0
      - prompt-toolkit=3.0.19=pyha770c72_0
      - prompt_toolkit=3.0.19=hd8ed1ab_0
      - pthread-stubs=0.4=h36c2ea0_1001
      - ptyprocess=0.7.0=pyhd3deb0d_0
      - pycparser=2.20=pyh9f0ad1d_2
      - pygments=2.9.0=pyhd8ed1ab_0
      - pyopenssl=20.0.1=pyhd8ed1ab_0
      - pyparsing=2.4.7=pyh9f0ad1d_0
      - pyqt=5.12.3=py38h578d9bd_7
      - pyqt-impl=5.12.3=py38h7400c14_7
      - pyqt5-sip=4.19.18=py38h709712a_7
      - pyqtchart=5.12=py38h7400c14_7
      - pyqtwebengine=5.12.1=py38h7400c14_7
      - pyrsistent=0.17.3=py38h497a2fe_2
      - pysocks=1.7.1=py38h578d9bd_3
      - python=3.8.10=h49503c6_1_cpython
      - python-dateutil=2.8.1=py_0
      - python_abi=3.8=1_cp38
      - pytz=2021.1=pyhd8ed1ab_0
      - pyzmq=22.1.0=py38h2035c66_0
      - qt=5.12.9=hda022c4_4
      - qtconsole=5.1.0=pyhd8ed1ab_0
      - qtpy=1.9.0=py_0
      - readline=8.1=h46c0cb4_0
      - requests=2.25.1=pyhd3deb0d_0
      - send2trash=1.7.1=pyhd8ed1ab_0
      - setuptools=49.6.0=py38h578d9bd_3
      - six=1.16.0=pyh6c4a22f_0
      - sniffio=1.2.0=py38h578d9bd_1
      - sqlite=3.36.0=h9cd32fc_0
      - terminado=0.10.1=py38h578d9bd_0
      - testpath=0.5.0=pyhd8ed1ab_0
      - tk=8.6.10=h21135ba_1
      - tornado=6.1=py38h497a2fe_1
      - traitlets=5.0.5=py_0
      - urllib3=1.26.5=pyhd8ed1ab_0
      - wcwidth=0.2.5=pyh9f0ad1d_2
      - webencodings=0.5.1=py_1
      - websocket-client=0.57.0=py38h578d9bd_4
      - wheel=0.36.2=pyhd3deb0d_0
      - widgetsnbextension=3.5.1=py38h578d9bd_4
      - xorg-libxau=1.0.9=h7f98852_0
      - xorg-libxdmcp=1.1.3=h7f98852_0
      - xz=5.2.5=h516909a_1
      - zeromq=4.3.4=h9c3ff4c_0
      - zipp=3.4.1=pyhd8ed1ab_0
      - zlib=1.2.11=h516909a_1010
      - zstd=1.5.0=ha95c52a_0
    prefix: /home/john/anaconda3/envs/test
Command Line Output
[D 2021-06-23 11:35:25.937 ServerApp] Searching ['/home/john/research/borehole', '/home/john/.jupyter', '/home/john/anaconda3/envs/test/etc/jupyter', '/usr/local/etc/jupyter', '/etc/jupyter'] for config files
[D 2021-06-23 11:35:25.937 ServerApp] Looking for jupyter_config in /etc/jupyter
[D 2021-06-23 11:35:25.937 ServerApp] Looking for jupyter_config in /usr/local/etc/jupyter
[D 2021-06-23 11:35:25.937 ServerApp] Looking for jupyter_config in /home/john/anaconda3/envs/test/etc/jupyter
[D 2021-06-23 11:35:25.937 ServerApp] Looking for jupyter_config in /home/john/.jupyter
[D 2021-06-23 11:35:25.937 ServerApp] Looking for jupyter_config in /home/john/research/borehole
[D 2021-06-23 11:35:25.938 ServerApp] Looking for jupyter_server_config in /etc/jupyter
[D 2021-06-23 11:35:25.938 ServerApp] Looking for jupyter_server_config in /usr/local/etc/jupyter
[D 2021-06-23 11:35:25.938 ServerApp] Looking for jupyter_server_config in /home/john/anaconda3/envs/test/etc/jupyter
[D 2021-06-23 11:35:25.938 ServerApp] Looking for jupyter_server_config in /home/john/.jupyter
[D 2021-06-23 11:35:25.938 ServerApp] Looking for jupyter_server_config in /home/john/research/borehole
[D 2021-06-23 11:35:25.940 ServerApp] Paths used for configuration of jupyter_server_config:
        /etc/jupyter/jupyter_server_config.json
[D 2021-06-23 11:35:25.940 ServerApp] Paths used for configuration of jupyter_server_config:
        /usr/local/etc/jupyter/jupyter_server_config.json
[D 2021-06-23 11:35:25.940 ServerApp] Paths used for configuration of jupyter_server_config:
        /home/john/anaconda3/envs/test/etc/jupyter/jupyter_server_config.d/jupyterlab.json
        /home/john/anaconda3/envs/test/etc/jupyter/jupyter_server_config.d/nbclassic.json
        /home/john/anaconda3/envs/test/etc/jupyter/jupyter_server_config.json
[D 2021-06-23 11:35:25.941 ServerApp] Paths used for configuration of jupyter_server_config:
        /home/john/.jupyter/jupyter_server_config.json
[D 2021-06-23 11:35:25.949 LabApp] Config changed: {'NotebookApp': {}, 'ServerApp': {'log_level': 'DEBUG', 'jpserver_extensions': }, 'ExtensionApp': {'log_level': 'DEBUG'}}
[I 2021-06-23 11:35:25.950 ServerApp] jupyterlab | extension was successfully linked.
[W 2021-06-23 11:35:25.951 NotebookApp] 'password' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[D 2021-06-23 11:35:25.955 NotebookApp] Config changed: {'NotebookApp': {}, 'ServerApp': {'password': 'sha1:641301ce7e02:c5c23291f86c05ec9fdda6abaa540087b746440f', 'log_level': 'DEBUG', 'jpserver_extensions': }, 'ExtensionApp': {'log_level': 'DEBUG'}}
[D 2021-06-23 11:35:26.055 ServerApp] Paths used for configuration of jupyter_notebook_config:
        /home/john/.jupyter/jupyter_notebook_config.json
[D 2021-06-23 11:35:26.055 ServerApp] Paths used for configuration of jupyter_notebook_config:
        /etc/jupyter/jupyter_notebook_config.json
[D 2021-06-23 11:35:26.056 ServerApp] Paths used for configuration of jupyter_notebook_config:
        /usr/local/etc/jupyter/jupyter_notebook_config.json
[D 2021-06-23 11:35:26.056 ServerApp] Paths used for configuration of jupyter_notebook_config:
        /home/john/anaconda3/envs/test/etc/jupyter/jupyter_notebook_config.d/jupyterlab.json
        /home/john/anaconda3/envs/test/etc/jupyter/jupyter_notebook_config.json
[D 2021-06-23 11:35:26.056 ServerApp] Paths used for configuration of jupyter_notebook_config:
        /home/john/.jupyter/jupyter_notebook_config.json
[I 2021-06-23 11:35:26.056 ServerApp] nbclassic | extension was successfully linked.
[D 2021-06-23 11:35:26.057 ServerApp] Config changed: {'ExtensionApp': {'log_level': 'DEBUG'}, 'NotebookApp': {}, 'ServerApp': {'password': 'sha1:641301ce7e02:c5c23291f86c05ec9fdda6abaa540087b746440f', 'log_level': 'DEBUG', 'jpserver_extensions': }}
[D 2021-06-23 11:35:26.057 ServerApp] Raising open file limit: soft 1024->4096; hard 1048576->1048576
[I 2021-06-23 11:35:26.087 ServerApp] nbclassic | extension was successfully loaded.
[I 2021-06-23 11:35:26.087 LabApp] JupyterLab extension loaded from /home/john/anaconda3/envs/test/lib/python3.8/site-packages/jupyterlab
[I 2021-06-23 11:35:26.087 LabApp] JupyterLab application directory is /home/john/anaconda3/envs/test/share/jupyter/lab
[I 2021-06-23 11:35:26.089 ServerApp] jupyterlab | extension was successfully loaded.
[I 2021-06-23 11:35:26.090 ServerApp] Serving notebooks from local directory: /home/john/research/borehole
[I 2021-06-23 11:35:26.090 ServerApp] Jupyter Server 1.8.0 is running at:
[I 2021-06-23 11:35:26.090 ServerApp] http://localhost:8888/lab
[I 2021-06-23 11:35:26.090 ServerApp]     http://127.0.0.1:8888/lab
[I 2021-06-23 11:35:26.090 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 2021-06-23 11:35:26.092 ServerApp] No web browser found: could not locate runnable browser.
fcollonval commented 3 years ago

Could you check you are actually using the kernel of the new environment?

You can list all installed kernels with the following command:

 jupyter kernelspec list

If you are seeing multiple kernel definition, you may need to pick the right one in the notebook.

You can do that by selecting Kernel > Change Kernel... in the menu:

image

mnky9800n commented 3 years ago

image

The only kernels that appear are the ones in this list. I am not sure why it has tensorflow, etc. in this list. Those are old kernels from other environments.

Also this is the output of the available kernels:

(borehole) john@vegeta:~/research$  jupyter kernelspec list
Available kernels:
  ir            /home/john/.local/share/jupyter/kernels/ir
  python3       /home/john/.local/share/jupyter/kernels/python3
  tensorflow    /home/john/.local/share/jupyter/kernels/tensorflow
  tf            /home/john/.local/share/jupyter/kernels/tf

I'm at a complete loss. In every step it seems like the jupyter lab server is coming from the borehole environment until i open a notebook and read the path which is clearly pointing to a different environment.

Is there some config file that exists somewhere outside of the environment that is getting referenced? When I checked the other environments I have they all actually have the same problem.

fcollonval commented 3 years ago

As you are using conda environment, I would advice you to install nb_conda_kernels in the same environment than JupyterLab. It will ease picking up the proper kernel. Then you should have the expected results for sys.path

mnky9800n commented 3 years ago

that worked thank you.