How to check the version of JupyterHub from command line? - jupyter

Maybe this question sounds basic, but how to check from a command line what is the version of my JupyterHub? I am running JupyterLab on JupyterHub. I was grepping various configs, helps and now I know what's the version of all the components apart from JupyterHub. It'd be great to know how I could do it from the command line. Thanks!

It occurred to be as simple as:
pip freeze | grep jupyterhub
jupyterhub==1.0.0

Related

Neovim ERROR: 492: Not an editor command: PlugInstall

Okay, so I have installed Neovim with "sudo apt install neovim" and made directory ".config/nvim/init.nvim". While typing in "init.nvim" no words got highlited e.g. :set number. When I tried to install all of the plugins, I got the message as in the title. Can anyone help me with that?
I have looked all over the internet, tried some of the thing people suggeste but unfortunately nothing worked. Should I maybe uninstall Ubuntu as I have windows subsystem for Linux and after that install it again?
The config filename for neovim is "init.vim", not "init.nvim".
Try running :
:echo $MYVIMRC
It should printout the location and the config file name for you.

I can not install OpenMDAO

I have installed Anaconda since it was recommended to use in the OpenMDAO's website. After that I typed pip install 'openmdao[all]' as instructed. However I get an error message saying, "ERROR: Invalid requirement: "'openmdao[all]'"" I was wondering how can I solve this issue. I have no knowledge about the Python or anaconda therefore I don't have a clue what to do about this situation. I searched the internet however I didn't find a solution to this. Thanks in advance!
It's possible you're running the wrong pip executable. Try which pip - it should be located under your home directory instead of a system path such as /bin/pip or /usr/bin/pip.
Make sure you've created and activated an environment in Anaconda:
conda create -n myenv pip
conda activate myenv
python -m pip install 'openmdao[all]'
That command sequence will give the highest chance of success. The single quotes are required for shells like zsh.
Remove the single quotes:
pip install openmdao[all]

Can't connect to jupyter server in vscode

My settings file looks like this
{
"python.pythonPath": "/home/username/.conda/envs/myenv/bin/python",
"terminal.integrated.inheritEnv": false
}
And I can see the conda environment in the interpreter that I'd like to activate from vscode interpreter selections but whenever I try to run the a cell in vscode I get a long error message.
Activating Python 3.7.7 64-bit ('myenv': conda) to run Jupyter failed with Error: Command failed: . activate myenv && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python /home/username/.vscode/extensions/ms-python.python-2020.8.105369/pythonFiles/pyvsc-run-isolated.py /home/username/.vscode/extensions/ms-python.python-2020.8.105369/pythonFiles/printEnvVariables.py bash: activate: No such file or directory .
I chdecked my $PATH variable and it each directory existed in it. (Looks like how other stack questions suggested it should look as well)
What am I missing? I had it working on a similar machine a couple weeks ago but I can't seem to get it to work now.
I'm on Ubuntu 20.04 if that's important.
I am not completely familiar with the issue, but some digging around lead me to this, try these settings
"terminal.integrated.env.linux": {
"PATH": ""
}
If that doesn't work please reference this link. They seem to be experiencing the same issue as you, but on windows. You may be able to extract more information from it than I could. Sorry if this didn't help.
After messing around quite a bit, I made a new environment and it worked. I'm not sure what I did within that environment to make vscode unhappy with it but vscode didn't like something about it.
Before making the new environment I also ran a few commands including
sudo chown -R $USER:$USER ~/.conda
sudo chown -R $USER:$USER ~/miniconda3
conda update -n base -c defaults conda
I'm not sure what got it to work but I'm happy it's working now!

How to install sagemath kernel in Jupyter

I could use Python Kernel with Jupyter. I am looking for a way to use sagemath inside Jupyter.I couldnt see a way for installing it. How to do that?
I have just installed SageMath kernel on my existing Jupyter installation. It's super easy.
$ sudo jupyter kernelspec install ./SageMath/local/share/jupyter/kernels/sagemath
Where SageMath is your root sagemath directory. Hope this will help someone.
If you don't have sudo rights you won't be able to install system-wide,
but you can still install for yourself using the --user flag:
$ jupyter kernelspec install --user ./SageMath/local/share/jupyter/kernels/sagemath
The answer suggesting
$ jupyter kernelspec install --user <path to SageMath/local/share/jupyter/kernels/sagemath>
works only if you provide the environment variable SAGE_ROOT in the kernel spec. This requires adding an "env" item to the kernel.json. The line that must be added is:
"env":{"SAGE_ROOT":"<Path to sage root>"}
An example specific to an installed mac app for version 8.7 is:
"env":{"SAGE_ROOT":"/Applications/SageMath-8.7.app/Contents/Resources/sage"}
See this question for general information and a complete example.
You are going about it backwards; Sage includes the Jupyter notebook inside of it, and you can use it with that kernel that way. (As well as others.) Use
$ sage --notebook ipython
I believe. See also here.
(I think there are also some people who have had success redirecting their Jupyter to "see" the Sage kernel by editing some file or configuration. On Arch Linux this is apparently supported ... ?)
I know this is an old question, but I stumbled onto it and ended up making a docker container to accomplish this for anyone who is interested.
https://hub.docker.com/r/sharptrick/sage-notebook
The dockerfile may be of interest as it has explicit instructions which install the kernel to the official "jupyter/minimal-notebook".
https://github.com/sharpTrick/sage-notebook/blob/master/Dockerfile

Unable to plot graphs in iPython notebook, OSX 10.6

i am trying to get inline graphs working in iPython notebook.. i begin by starting ipython with the command ipython notebook --pylab inline.
when i try to use the plot() function i get the following error
im running on OSX 10.6.8 and running ipython out of a virtualenv i have matplotlib and libpng installed
i also get this warning in the terminal
libpng warning: Application built with libpng-1.2.41 but running with 1.5.13
and plot() works normally when i use ipython in the terminal only when i use ipython notebook i get this error.. can someone help me with this..?
I had this problem as well. Another solution is to change the format which the notebook will render images in, from 'png' to 'svg'. This can be done in your config file. Mine is located at:
~/.ipython/profile_default/ipython_notebook_config.py
There is a line that looks like this
# c.InlineBackend.figure_format = 'png'
Uncommenting and changing to 'svg' did the trick for me:
c.InlineBackend.figure_format = 'svg'
This recent question on this board is similar to yours: matplotlib and libpng issues with ipython notebook
See if the solution there solves your issue.
so i finally got this working..
first off i had to get all my outdated ports updated
first i did port selfupdate
then sudo port update outdated
after that i reinstalled ipython using mac ports
sudo port install py27-ipython
then i had to install tornado and pyzmq respectively as ipython depends on it
sudo port install py27-tornado
sudo port install py27-zmq
and then ran it from the terminal
ipython notebook --pylab inline
everything works fine now i can plot maps inline in ipython!
i guess the reason it didnt work before was some problems with pip maybe its installing matplotlib that is build only for libpng 1.2.41 ??... so anyways if anyone else faces this problem id suggest reinstalling all the libraries and ipython via mac ports thats the only thing that worked for me.
Since it was complaining that the versions of libpng used for building and for running are different, I have reinstalled the matplotlib by forcing the path to includes.
CFLAGS="`libpng-config --cflags`" pip install matplotlib -I