Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is_hidden in jupyter_server==1.4.1 import breaks with jupyter_core==4.7.1 #496

Closed
astrophysaxist opened this issue Apr 30, 2021 · 5 comments · Fixed by #509
Closed

is_hidden in jupyter_server==1.4.1 import breaks with jupyter_core==4.7.1 #496

astrophysaxist opened this issue Apr 30, 2021 · 5 comments · Fixed by #509
Labels

Comments

@astrophysaxist
Copy link

Description

Hi, I've been chasing some errors when I go to run open a jupyter notebook in a virtual environment with jupyter_server==1.4.1 and jupyter_core==4.7.1. I has traced it to what looks like a deprecated import in the base/handler.py file. Here's a snapshot of the errors on the start of a jupyter notebook --no-browser --port=8889 call:

    Traceback (most recent call last):
      File "/software/linux/usr1/local/anaconda_py3/anaconda3-2018.12-Linux-x86_64/lib/python3.7/site-packages/notebook/notebookapp.py", line 1572, in init_server_extensions
        mod = importlib.import_module(modulename)
      File "/local/data/home/[user]/.conda/envs/rapids-0.19/lib/python3.7/importlib/__init__.py", line 127, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
      File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
      File "<frozen importlib._bootstrap>", line 983, in _find_and_load
      File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 728, in exec_module
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "/local/data/home/[user]/.conda/envs/rapids-0.19/lib/python3.7/site-packages/jupyter_server_proxy/__init__.py", line 1, in <module>
        from .handlers import setup_handlers, SuperviseAndProxyHandler
      File "/local/data/home/[user]/.conda/envs/rapids-0.19/lib/python3.7/site-packages/jupyter_server_proxy/handlers.py", line 17, in <module>
        from jupyter_server.base.handlers import JupyterHandler, utcnow
      File "/local/data/home/[user]/.conda/envs/rapids-0.19/lib/python3.7/site-packages/jupyter_server/base/handlers.py", line 31, in <module>
        from jupyter_core.paths import is_hidden
    ImportError: cannot import name 'is_hidden' from 'jupyter_core.paths' (/software/linux/usr1/local/anaconda_py3/anaconda3-2018.12-Linux-x86_64/lib/python3.7/site-packages/jupyter_core/paths.py)

Reproduce

A minimal environment to stand up and test can be made with:
conda create -n test -c rapidsai -c nvidia -c conda-forge jupyter jupyter_server=1.4.1 jupyter-server-proxy=3.0.2 jupyter_core=4.7.1 python=3.7

Activate the environment with conda activate test. Then execute a jupyter notebook command.

Context

I'm running this on a CentOS7 machine in a virtual environment not too different from the one above. I've been tracking down why the wrong libraries seem to be grabbed in the jupyter notebook, and discovered this along the way.

Troubleshoot Output
$PATH:
	/local/data/home/[user]/.conda/envs/test/bin
	/local/data/home/[user]/.conda/envs/test/bin
	/usr1/local/anaconda_py3/anaconda3-2018.12-Linux-x86_64/condabin
	/usr1/local/anaconda_py3/anaconda3-2018.12-Linux-x86_64/bin
	/usr1/local/anaconda/bin
	/usr/ucb
	/usr/bin/X11
	/usr1/local/gnu/bin
	/usr/etc
	/usr/bin
	/usr1/local/anaconda/bin
	.
	/usr/local/bin
	/usr1/local/bin
	/bin
	/local/data/home/[user]/bin
	.
	/local/data/home/[user]/.local/bin

sys.path:
/local/data/home/[user]/.conda/envs/test/bin
/local/data/imes1/[user]
/local/data/home/[user]
/local/data/home/[user]/.conda/envs/test/lib/python37.zip
/local/data/home/[user]/.conda/envs/test/lib/python3.7
/local/data/home/[user]/.conda/envs/test/lib/python3.7/lib-dynload
/local/data/home/[user]/.local/lib/python3.7/site-packages
/local/data/home/[user]/.local/lib/python3.7/site-packages/GalSim-2.1.5-py3.7-linux-x86_64.egg
/software/linux/usr1/local/anaconda_py3/anaconda3-2018.12-Linux-x86_64/lib/python3.7/site-packages
/local/data/home/[user]/.conda/envs/test/lib/python3.7/site-packages

sys.executable:
/local/data/home/[user]/.conda/envs/test/bin/python

sys.version:
3.7.10 | packaged by conda-forge | (default, Feb 19 2021, 16:07:37)
[GCC 9.3.0]

platform.platform():
Linux-3.10.0-1160.24.1.el7.x86_64-x86_64-with-redhat-7.9-Nitrogen

which -a jupyter:
/local/data/home/[user]/.conda/envs/test/bin/jupyter
/local/data/home/[user]/.conda/envs/test/bin/jupyter
/usr1/local/anaconda_py3/anaconda3-2018.12-Linux-x86_64/bin/jupyter
/usr1/local/anaconda/bin/jupyter
/usr1/local/anaconda/bin/jupyter

pip list:
Package Version
---------------------------------- ----------------------
absl-py 0.7.1
aiohttp 3.7.4.post0
aiohttp-cors 0.7.0
aioredis 1.3.1
aiosmtpd 1.2.2
alabaster 0.7.12
alembic 1.4.3
anaconda-client 1.7.2
anaconda-navigator 1.9.6
anaconda-project 0.8.2
ansible 2.9.4
anyio 2.2.0
argon2-cffi 20.1.0
arviz 0.10.0
asdf 2.3.3
asn1crypto 0.24.0
astor 0.7.1
astroid 2.1.0
astropy 3.1
astroquery 0.3.9
async-generator 1.10
async-timeout 3.0.1
atomicwrites 1.2.1
atpublic 2.1.1
attrs 20.3.0
authheaders 0.13.0
authres 1.2.0
autograd 1.2
Babel 2.6.0
backcall 0.1.0
backports.functools-lru-cache 1.6.4
backports.os 0.1.1
backports.shutil-get-terminal-size 1.0.0
basemap 1.2.0
beautifulsoup4 4.9.3
bitarray 0.8.3
bkcharts 0.2
bleach 3.0.2
blessings 1.7
bokeh 1.0.2
boto 2.49.0
Bottleneck 1.2.1
bs4 0.0.1
cachetools 4.2.1
Cartopy 0.16.0
certifi 2020.12.5
cffi 1.11.5
cftime 1.2.1
chardet 4.0.0
click 7.1.2
cloudpickle 0.5.0
clyent 1.2.2
colorama 0.4.4
colorful 0.5.4
conda 4.9.2
conda-build 3.18.9
conda-package-handling 1.6.0
conda-verify 3.1.1
configparser 5.0.0
contextlib2 0.5.5
corner 2.0.1
cryptography 2.4.2
cvxpy 1.0.21
cycler 0.10.0
Cython 0.29.2
cytoolz 0.9.0.1
dask 1.0.0
datashape 0.5.4
decorator 4.3.0
defusedxml 0.5.0
dill 0.2.9
distributed 1.25.1
dkimpy 1.0.5
dnspython 2.0.0
docutils 0.14
ecos 2.0.7.post1
eleanor 0.1.8
emcee 0.0.0
entrypoints 0.2.3
et-xmlfile 1.0.1
falcon 2.0.0
fastcache 1.0.2
fastprogress 1.0.0
fbpca 1.0
filelock 3.0.12
fitsio 1.0.5
Flask 1.0.2
Flask-Cors 3.0.7
flufl.bounce 3.0.1
flufl.i18n 3.1.3
flufl.lock 5.0.3
funcsigs 1.0.2
future 0.17.1
GalSim 2.1.5
gast 0.2.2
gevent 1.3.7
glob2 0.6
gmpy2 2.0.8
google 3.0.0
google-api-core 1.26.1
google-auth 1.27.1
googleapis-common-protos 1.53.0
gpustat 0.6.0
greenlet 0.4.15
grpcio 1.20.0
gunicorn 20.0.4
h5py 2.8.0
heapdict 1.0.0
hiredis 1.1.0
html5lib 1.0.1
idna 2.10
imageio 2.4.1
imagesize 1.1.0
importlib-metadata 3.7.3
importlib-resources 3.3.0
imutils 0.5.3
ipykernel 5.1.0
ipython 7.2.0
ipython-genutils 0.2.0
ipywidgets 7.4.2
isort 4.3.4
itsdangerous 1.1.0
jdcal 1.4
jedi 0.13.2
jeepney 0.4
Jinja2 2.10
jsonschema 3.2.0
jupyter 1.0.0
jupyter-client 5.2.4
jupyter-console 6.0.0
jupyter-core 4.4.0
jupyter-server 1.4.1
jupyter-server-proxy 3.0.2
jupyterlab 0.35.3
jupyterlab-pygments 0.1.2
jupyterlab-server 0.2.0
jupyterlab-widgets 1.0.0
Keras-Applications 1.0.7
Keras-Preprocessing 1.0.9
keyring 17.0.0
kiwisolver 1.0.1
lazr.config 2.2.2
lazr.delegates 2.0.4
lazy-object-proxy 1.3.1
LDTk 1.4.1
libarchive-c 2.8
lief 0.9.0
lightkurve 1.9.1
llvmlite 0.36.0
locket 0.2.0
LSSTDESC.Coord 1.1.1
lxml 4.2.5
mailman 3.3.2
Markdown 3.1
MarkupSafe 1.1.0
matplotlib 3.1.3
mccabe 0.6.1
mirage 0.0.0.dev608+g4990ce9e
mistune 0.8.4
mkl-fft 1.0.6
mkl-random 1.0.2
mock 2.0.0
more-itertools 4.3.0
mpi4py 3.0.2
mplcursors 0.2.1
mpmath 1.1.0
msgpack 1.0.2
muchbettermoments 1.0.0
multidict 5.1.0
multipledispatch 0.6.0
multiprocess 0.70.7
mysqlclient 2.0.3
navigator-updater 0.2.1
nbclient 0.5.3
nbconvert 5.4.0
nbformat 4.4.0
nest-asyncio 1.5.1
netCDF4 1.4.1
networkx 2.2
nltk 3.4
nose 1.3.7
notebook 5.7.4
numba 0.53.1
numexpr 2.6.8
numpy 1.19.5
numpydoc 0.8.0
nvidia-ml-py3 7.352.0
odo 0.5.1
oktopus 0.1.2
olefile 0.46
opencensus 0.7.12
opencensus-context 0.1.2
opencv-python 4.2.0.32
openpyxl 2.5.12
osqp 0.5.0
OWSLib 0.17.0
packaging 20.9
pandas 1.2.0
pandocfilters 1.4.2
parso 0.3.1
partd 0.3.9
passlib 1.7.4
path.py 11.5.0
pathlib2 2.3.3
patsy 0.5.1
pbr 5.1.3
pep8 1.7.1
pexpect 4.6.0
photutils 0.6
pickle5 0.0.11
pickleshare 0.7.5
Pillow 5.3.0
pip 21.1
pkginfo 1.4.2
pluggy 0.8.0
ply 3.11
prometheus-client 0.9.0
prompt-toolkit 2.0.7
protobuf 3.15.6
psutil 5.8.0
psycopg2 2.8.5
ptyprocess 0.6.0
publicsuffix2 2.20191221
py 1.7.0
py-spy 0.3.4
pyasn1 0.4.8
pyasn1-modules 0.2.8
pybind11 2.2.4
pycodestyle 2.4.0
pycosat 0.6.3
pycparser 2.19
pycrypto 2.6.1
pycurl 7.43.0.2
pyepsg 0.4.0
pyflakes 2.0.0
Pygments 2.3.1
pygmo 2.13.0
pylint 2.2.2
pymc3 3.10.0
pymc3-ext 0.0.2
pyodbc 4.0.25
pyOpenSSL 18.0.0
pyparsing 2.4.7
pyprof2calltree 1.4.4
pyproj 1.9.5.1
PyQt5 5.12.3
PyQt5-sip 4.19.18
PyQtChart 5.12
PyQtWebEngine 5.12.1
pyrsistent 0.17.3
pyshp 2.0.1
pysiaf 0.2.5
PySocks 1.6.8
pysynphot 1.0.0
pytest 4.0.2
pytest-arraydiff 0.3
pytest-astropy 0.5.0
pytest-doctestplus 0.2.0
pytest-openfiles 0.3.1
pytest-remotedata 0.3.1
python-dateutil 2.7.5
python-editor 1.0.4
pytz 2021.1
PyWavelets 1.0.1
PyYAML 5.4.1
pyzmq 17.1.2
QtAwesome 0.5.3
qtconsole 4.4.3
QtPy 1.5.2
ray 0.8.6
redis 3.4.1
requests 2.25.1
rmjarvis.eigency 1.77.1
rope 0.11.0
rpy2 3.0.4
rsa 4.7.2
ruamel-yaml 0.15.46
schwimmbad 0.3.1
scikit-image 0.14.1
scikit-learn 0.20.1
scipy 1.1.0
seaborn 0.9.0
SecretStorage 3.1.0
semantic-version 2.6.0
Send2Trash 1.5.0
setproctitle 1.1.10
setuptools 54.1.2
Shapely 1.6.4.post1
simpervisor 0.4
simplegeneric 0.8.1
singledispatch 3.4.0.3
six 1.15.0
sniffio 1.2.0
snowballstemmer 1.2.1
sortedcollections 1.0.1
sortedcontainers 2.1.0
soupsieve 2.2
Sphinx 1.8.2
sphinxcontrib-websupport 1.1.0
spyder 3.3.2
spyder-kernels 0.3.0
SQLAlchemy 1.2.15
starlink-pyast 3.12.1
statsmodels 0.11.1
sympy 1.3
tables 3.4.4
tblib 1.3.2
tenacity 6.3.1
tensorboard 1.13.1
tensorflow 1.13.1
tensorflow-estimator 1.13.0
termcolor 1.1.0
terminado 0.8.1
testpath 0.4.2
Theano-PyMC 1.0.11
toolz 0.9.0
tornado 5.1.1
tqdm 4.28.1
traitlets 4.3.2
typing-extensions 3.7.4.3
uncertainties 3.1.2
unicodecsv 0.14.1
urllib3 1.26.4
vaneska 0.0.dev0
wcwidth 0.1.7
webencodings 0.5.1
Werkzeug 0.14.1
wheel 0.32.3
widgetsnbextension 3.4.2
wrapt 1.10.11
wurlitzer 1.0.2
xarray 0.16.2
xlrd 1.2.0
XlsxWriter 1.1.2
xlwt 1.3.0
yarl 1.6.3
zict 0.1.3
zipp 3.4.1
zope.component 4.6.2
zope.configuration 4.4.0
zope.deferredimport 4.3.1
zope.deprecation 4.4.0
zope.event 4.5.0
zope.hookable 5.0.1
zope.i18nmessageid 5.0.1
zope.interface 5.2.0
zope.proxy 4.3.5
zope.schema 6.0.0

conda list:
# packages in environment at /local/data/home/[user]/.conda/envs/test:
#
# Name Version Build Channel
_libgcc_mutex 0.1 conda_forge conda-forge
_openmp_mutex 4.5 1_gnu conda-forge
aiohttp 3.7.4 py37h5e8e339_0 conda-forge
alsa-lib 1.2.3 h516909a_0 conda-forge
anyio 2.2.0 py37h89c1867_0 conda-forge
argon2-cffi 20.1.0 py37h5e8e339_2 conda-forge
async-timeout 3.0.1 py_1000 conda-forge
async_generator 1.10 py_0 conda-forge
attrs 20.3.0 pyhd3deb0d_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
ca-certificates 2020.12.5 ha878542_0 conda-forge
certifi 2020.12.5 py37h89c1867_1 conda-forge
cffi 1.14.5 py37hc58025e_0 conda-forge
chardet 4.0.0 py37h89c1867_1 conda-forge
dbus 1.13.6 h48d8840_2 conda-forge
decorator 5.0.7 pyhd8ed1ab_0 conda-forge
defusedxml 0.7.1 pyhd8ed1ab_0 conda-forge
entrypoints 0.3 pyhd8ed1ab_1003 conda-forge
expat 2.3.0 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.1 h9c3ff4c_0 conda-forge
glib-tools 2.68.1 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 3.1 pyhd3deb0d_0 conda-forge
importlib-metadata 4.0.1 py37h89c1867_0 conda-forge
ipykernel 5.5.3 py37h085eea5_0 conda-forge
ipython 7.22.0 py37h085eea5_0 conda-forge
ipython_genutils 0.2.0 py_1 conda-forge
ipywidgets 7.6.3 pyhd3deb0d_0 conda-forge
jedi 0.18.0 py37h89c1867_2 conda-forge
jinja2 2.11.3 pyh44b312d_0 conda-forge
jpeg 9d h36c2ea0_0 conda-forge
jsonschema 3.2.0 pyhd8ed1ab_3 conda-forge
jupyter 1.0.0 py37h89c1867_6 conda-forge
jupyter-server-proxy 3.0.2 pyhd8ed1ab_0 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 py37h89c1867_0 conda-forge
jupyter_server 1.4.1 py37h06a4308_0
jupyterlab_pygments 0.1.2 pyh9f0ad1d_0 conda-forge
jupyterlab_widgets 1.0.0 pyhd8ed1ab_1 conda-forge
krb5 1.17.2 h926e7f8_0 conda-forge
ld_impl_linux-64 2.35.1 hea4e1c9_2 conda-forge
libclang 11.1.0 default_ha53f305_0 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.1 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.2 hfd2b0eb_2 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.10 h72842e0_4 conda-forge
lz4-c 1.9.3 h9c3ff4c_0 conda-forge
markupsafe 1.1.1 py37h5e8e339_3 conda-forge
mistune 0.8.4 py37h5e8e339_1003 conda-forge
multidict 5.1.0 py37h5e8e339_1 conda-forge
mysql-common 8.0.23 ha770c72_1 conda-forge
mysql-libs 8.0.23 h935591d_1 conda-forge
nbclient 0.5.3 pyhd8ed1ab_0 conda-forge
nbconvert 6.0.7 py37h89c1867_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.3.0 pyha770c72_1 conda-forge
nspr 4.30 h9c3ff4c_0 conda-forge
nss 3.64 hb5efdd6_0 conda-forge
openssl 1.1.1k h7f98852_0 conda-forge
packaging 20.9 pyh44b312d_0 conda-forge
pandoc 2.12 h7f98852_0 conda-forge
pandocfilters 1.4.2 py_1 conda-forge
parso 0.8.2 pyhd8ed1ab_0 conda-forge
pcre 8.44 he1b5a44_0 conda-forge
pexpect 4.8.0 pyh9f0ad1d_2 conda-forge
pickleshare 0.7.5 py_1003 conda-forge
pip 21.1 pyhd8ed1ab_0 conda-forge
prometheus_client 0.10.1 pyhd8ed1ab_0 conda-forge
prompt-toolkit 3.0.18 pyha770c72_0 conda-forge
prompt_toolkit 3.0.18 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.8.1 pyhd8ed1ab_0 conda-forge
pyparsing 2.4.7 pyh9f0ad1d_0 conda-forge
pyqt 5.12.3 py37h89c1867_7 conda-forge
pyqt-impl 5.12.3 py37he336c9b_7 conda-forge
pyqt5-sip 4.19.18 py37hcd2ae1e_7 conda-forge
pyqtchart 5.12 py37he336c9b_7 conda-forge
pyqtwebengine 5.12.1 py37he336c9b_7 conda-forge
pyrsistent 0.17.3 py37h5e8e339_2 conda-forge
python 3.7.10 hffdb5ce_100_cpython conda-forge
python-dateutil 2.8.1 py_0 conda-forge
python_abi 3.7 1_cp37m conda-forge
pyzmq 22.0.3 py37h336d617_1 conda-forge
qt 5.12.9 hda022c4_4 conda-forge
qtconsole 5.0.3 pyhd8ed1ab_0 conda-forge
qtpy 1.9.0 py_0 conda-forge
readline 8.1 h46c0cb4_0 conda-forge
send2trash 1.5.0 py_0 conda-forge
setuptools 49.6.0 py37h89c1867_3 conda-forge
simpervisor 0.4 pyhd8ed1ab_0 conda-forge
six 1.15.0 pyh9f0ad1d_0 conda-forge
sniffio 1.2.0 py37h89c1867_1 conda-forge
sqlite 3.35.5 h74cdb3f_0 conda-forge
terminado 0.9.4 py37h89c1867_0 conda-forge
testpath 0.4.4 py_0 conda-forge
tk 8.6.10 h21135ba_1 conda-forge
tornado 6.1 py37h5e8e339_1 conda-forge
traitlets 5.0.5 py_0 conda-forge
typing-extensions 3.7.4.3 0 conda-forge
typing_extensions 3.7.4.3 py_0 conda-forge
wcwidth 0.2.5 pyh9f0ad1d_2 conda-forge
webencodings 0.5.1 py_1 conda-forge
wheel 0.36.2 pyhd3deb0d_0 conda-forge
widgetsnbextension 3.5.1 py37h89c1867_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
yarl 1.6.3 py37h5e8e339_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.4.9 ha95c52a_0 conda-forge

@welcome
Copy link

welcome bot commented Apr 30, 2021

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@kevin-bates
Copy link
Member

hi @astrophysaxist - thanks for opening this issue.

It's not clear to me when a pip-installed module would take precedence over a conda-installed module within an active conda environment, but it seems clear that the pip-installed version of jupyter_core is being picked up here. Since its version is 4.4.0, it would explain why is_hidden() is missing.

jupyter-core                       4.4.0

One thing worth exploring is that you're using jupyter notebook as the command and I see its version also varies between the pip and conda outputs. It might be an interesting data point to run jupyter lab from the active conda env. This should start Lab >= 3 and is a pure "jupyter-server play". You might also try juptyer nbclassic - which runs the notebook classic front-end as a server extension on jupyter-server - if you need the classic UX.

Of course, these experiments only provide data points (and possible workarounds) but don't address the underlying issue that you're picking up packages from older locations.

I'm hoping someone with deeper Python experience than myself can help explain when Pip trumps Conda. I'd love to better understand this.

@astrophysaxist
Copy link
Author

Hi @kevin-bates, I think you're right. I did each one of the experiments and I do see the same error.

(rapids-0.19)$ jupyter nbclassic
Traceback (most recent call last):
  File "/local/data/home/[user]/.conda/envs/rapids-0.19/bin/jupyter-nbclassic", line 6, in <module>
    from nbclassic.notebookapp import main
  File "/local/data/home/[user]/.conda/envs/rapids-0.19/lib/python3.7/site-packages/nbclassic/__init__.py", line 1, in <module>
    from .notebookapp import NotebookApp
  File "/local/data/home/[user]/.conda/envs/rapids-0.19/lib/python3.7/site-packages/nbclassic/notebookapp.py", line 34, in <module>
    from jupyter_server.base.handlers import FileFindHandler
  File "/local/data/home/[user]/.conda/envs/rapids-0.19/lib/python3.7/site-packages/jupyter_server/base/handlers.py", line 31, in <module>
    from jupyter_core.paths import is_hidden
ImportError: cannot import name 'is_hidden' from 'jupyter_core.paths' (/software/linux/usr1/local/anaconda_py3/anaconda3-2018.12-Linux-x86_64/lib/python3.7/site-packages/jupyter_core/paths.py)

I would've thought the jupyter_core grabbed would be from the conda environment. I'm looking around to see if there's an environmental variable I could change, but so far no luck.

@kevin-bates
Copy link
Member

You might try updating jupyter_core via the active env: conda update -c conda-forge jupyter_core or remove/install - just in case there's some kind of "registration" snafu with conda.

@kevin-bates
Copy link
Member

Looks like we should bump our dependency on jupyter_core to >= 4.6.0 - which is when is_hidden() was moved there. Since server "inherited" its dependencies from notebook (and notebook has its own copy of is_hidden(), yet we cleaned this up in server), users running server against older configurations can encounter this issue. I'll post a PR for this shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants