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

Notebook svg output OK in jupyterlab but KO using jupyterhub #4716

Open
mottelet opened this issue Mar 1, 2024 · 2 comments
Open

Notebook svg output OK in jupyterlab but KO using jupyterhub #4716

mottelet opened this issue Mar 1, 2024 · 2 comments
Labels

Comments

@mottelet
Copy link

mottelet commented Mar 1, 2024

Bug description

Hello, I am curently setting up a jupyterhub server using tljh distribution (https://tljh.jupyter.org/en/latest/) on a Linux Ubuntu 20.04.6 LTS and using the Calysto Scilab kernel (https://github.com/Calysto/scilab_kernel).

On an example notebook run in a jupyterhub session, outputing a graph under svg format, the graph is cropped (some labels and legends do not appear), although running the same notebook outside jupyterhub yields a correct output (graph is not cropped):

Both environments use jupyterlab 4.1.2 and latest Scilab kernel (0.10).

How to reproduce

Install official tljh distribution, install latest scilab 2024.0.0 (www.scilab.org), install the Scilab kernel from within a console in jupyterhub as admin user, add the path to scilab-adv-cli in
/opt/tljh/user/share/jupyter/kernels/scilab/kernel.json:

{
   "argv":[
      "/opt/tljh/user/bin/python",
      "-m",
      "scilab_kernel",
      "-f",
      "{connection_file}"
   ],
   "env":{
      "SCILAB_EXECUTABLE":"PATH_WHERE_SCILAB_WAS_INSTALLED/scilab-2024.0.0/bin/scilab-adv-cli"
   },
   "display_name":"Scilab",
   "language":"scilab",
   "mimetype":"text/x-scilab",
   "name":"scilab"
}

login to the jupyterhub (http://localhost:8080), create a new Scilab notebook and paste the following code in the first cell:

h=10.^-(1:0.05:15)';
hstar=2*sqrt(%eps*cos(1))
clf
plot(h,abs((cos(1+h)-cos(1))./h+sin(1))/sin(1));gca().log_flags="ll";
plot([hstar,hstar],[1e-10,1e-1],'-r')
xstring(hstar,1e-10,"$\LARGE h^*$")
xlabel("$\LARGE h$");ylabel("$\LARGE\left|\frac{f''(1)-D(h)}{f''(1)}\right|$")
isoview

Expected behaviour

when running the same notebook in classical jupyterlab

Screenshot 2024-03-01 at 17 15 15

Actual behaviour

when running the notebook in jupyterhub

Screenshot 2024-03-01 at 11 02 00

Your personal set up

  • OS: Linux Ubuntu 20.04.6 LTS
    Below from a console within jupyterhub session
jupyter-mottelet@marguerite:~$ jupyterhub --version
4.0.2
jupyter-mottelet@marguerite:~$ jupyter --version
Selected Jupyter core packages...
IPython          : 8.11.0
ipykernel        : 6.22.0
ipywidgets       : 7.7.4
jupyter_client   : 8.1.0
jupyter_core     : 5.3.0
jupyter_server   : 2.12.5
jupyterlab       : 4.1.2
nbclient         : 0.7.2
nbconvert        : 7.2.10
nbformat         : 5.8.0
notebook         : 7.1.1
qtconsole        : 5.5.1
traitlets        : 5.9.0

jupyter-mottelet@marguerite:~$ python --version
Python 3.9.7
Full environment
jupyter-mottelet@marguerite:~$ pip freeze
aiofiles==22.1.0
aiosqlite==0.18.0
alembic==1.10.2
anyio==3.6.2
argon2-cffi==21.3.0
argon2-cffi-bindings==21.2.0
arrow==1.2.3
asttokens==2.2.1
async-generator==1.10
async-lru==2.0.4
attrs==22.2.0
Babel==2.12.1
backcall==0.2.0
beautifulsoup4==4.12.0
bleach==6.0.0
brotlipy==0.7.0
certifi==2022.12.7
certipy==0.1.3
cffi @ file:///home/conda/feedstock_root/build_artifacts/cffi_1631636250774/work
chardet @ file:///home/conda/feedstock_root/build_artifacts/chardet_1610093492116/work
charset-normalizer @ file:///home/conda/feedstock_root/build_artifacts/charset-normalizer_1626371162869/work
colorama @ file:///home/conda/feedstock_root/build_artifacts/colorama_1602866480661/work
comm==0.1.3
conda==4.10.3
conda-package-handling @ file:///home/conda/feedstock_root/build_artifacts/conda-package-handling_1618231390031/work
cryptography @ file:///home/conda/feedstock_root/build_artifacts/cryptography_1633983255347/work
debugpy==1.6.6
decorator==5.1.1
defusedxml==0.7.1
entrypoints==0.4
executing==1.2.0
fastjsonschema==2.16.3
fqdn==1.5.1
greenlet==2.0.2
h11==0.14.0
httpcore==1.0.4
httpx==0.27.0
idna @ file:///home/conda/feedstock_root/build_artifacts/idna_1609836280497/work
importlib-metadata==6.1.0
ipykernel==6.22.0
ipython==8.11.0
ipython-genutils==0.2.0
ipywidgets==7.7.4
isoduration==20.11.0
jedi==0.18.2
Jinja2==3.1.2
json5==0.9.11
jsonpointer==2.3
jsonschema==4.21.1
jsonschema-specifications==2023.12.1
jupyter==1.0.0
jupyter-console==6.6.3
jupyter-events==0.9.0
jupyter-lsp==2.2.3
jupyter-resource-usage==0.6.4
jupyter-telemetry==0.1.0
jupyter-ydoc==0.2.3
jupyter_client==8.1.0
jupyter_core==5.3.0
jupyter_server==2.12.5
jupyter_server_fileid==0.8.0
jupyter_server_terminals==0.5.2
jupyter_server_ydoc==0.8.0
jupyterhub==4.0.2
jupyterlab==4.1.2
jupyterlab-pygments==0.2.2
jupyterlab-widgets==1.1.3
jupyterlab_server==2.25.3
Mako==1.2.4
mamba @ file:///home/conda/feedstock_root/build_artifacts/mamba_1632770295204/work
MarkupSafe==2.1.2
matplotlib-inline==0.1.6
metakernel==0.30.1
mistune==2.0.5
nbclassic==0.5.3
nbclient==0.7.2
nbconvert==7.2.10
nbformat==5.8.0
nbgitpuller==1.1.1
nest-asyncio==1.5.6
notebook==7.1.1
notebook_shim==0.2.2
nteract-on-jupyter==2.1.3
oauthlib==3.2.2
overrides==7.7.0
packaging==23.0
pamela==1.0.0
pandocfilters==1.5.0
parso==0.8.3
pexpect==4.8.0
pickleshare==0.7.5
platformdirs==3.2.0
prometheus-client==0.16.0
prompt-toolkit==3.0.38
psutil==5.9.4
ptyprocess==0.7.0
pure-eval==0.2.2
pycosat @ file:///home/conda/feedstock_root/build_artifacts/pycosat_1610094799048/work
pycparser @ file:///home/conda/feedstock_root/build_artifacts/pycparser_1593275161868/work
Pygments==2.14.0
pyOpenSSL @ file:///home/conda/feedstock_root/build_artifacts/pyopenssl_1633192417276/work
pyrsistent==0.19.3
PySocks @ file:///home/conda/feedstock_root/build_artifacts/pysocks_1610291451001/work
python-dateutil==2.8.2
python-json-logger==2.0.7
PyYAML==6.0
pyzmq==25.0.2
qtconsole==5.5.1
QtPy==2.4.1
referencing==0.33.0
requests @ file:///home/conda/feedstock_root/build_artifacts/requests_1684774241324/work
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
rpds-py==0.18.0
ruamel-yaml-conda @ file:///home/conda/feedstock_root/build_artifacts/ruamel_yaml_1611943432947/work
ruamel.yaml==0.17.21
ruamel.yaml.clib==0.2.7
scilab-kernel==0.10.0
Send2Trash==1.8.2
six @ file:///home/conda/feedstock_root/build_artifacts/six_1620240208055/work
sniffio==1.3.0
soupsieve==2.4
SQLAlchemy==1.4.47
stack-data==0.6.2
terminado==0.17.1
tinycss2==1.2.1
tomli==2.0.1
tornado==6.2
tqdm @ file:///home/conda/feedstock_root/build_artifacts/tqdm_1632160078689/work
traitlets==5.9.0
typing_extensions==4.5.0
uri-template==1.2.0
urllib3 @ file:///home/conda/feedstock_root/build_artifacts/urllib3_1632350318291/work
wcwidth==0.2.6
webcolors==1.13
webencodings==0.5.1
websocket-client==1.5.1
widgetsnbextension==3.6.3
y-py==0.5.9
ypy-websocket==0.8.2
zipp==3.15.0
@mottelet mottelet added the bug label Mar 1, 2024
Copy link

welcome bot commented Mar 1, 2024

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! 🎉

@minrk
Copy link
Member

minrk commented Mar 19, 2024

Both screenshots are from the same environment (sys.executable matches) as the same user on the same system?

You might try running https://github.com/minrk/envreport to see if you can spot a difference between the two environments.

It's very unlikely this is related to JupyterHub itself, instead being a difference of environment loading different configuration. For example, launching a server in JupyterHub typically doesn't source your .bash_profile, etc. which may set various environment variables that are relevant.

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

No branches or pull requests

2 participants