jupyter / notebook

Jupyter Interactive Notebook
https://jupyter-notebook.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
11.72k stars 4.96k forks source link

Installing jupyter notebook in a virtual env at a public cluster #3618

Open matthew-hsr opened 6 years ago

matthew-hsr commented 6 years ago

I am trying to run jupyter notebook in a virtualenv on a cluster computing platform running Linux, but I am unable to install a ipykernel for jupyter notebook. Original stack overflow question is here.

I tried to follow these instructions. pip install jupyter and pip install ipykernel worked properly, saying requirement already satisfied. But python -m ipykernel install --user --name testenv --display-name "MyEnv" does not work, returning

[Errno 13] Permission denied: '/tmp/tmpc2ebdyp9_kernels/python3/kernel.json'
Perhaps you want `sudo` or `--user`?

which really confuses me, as I thought the --user tag should make it install at my local directory already. I also tried specifying the path of my virtualenv by using --prefix, but it is still saying I have no permission to access the system's kernel.json.

I also tried ipython kernel install --name "xx" --user and specifying path with --prefix but it returns the same error.

So my question is:

  1. How come the installation still tries to access the tmp folder, even though I specified --tags and --prefix? Did the tags --user or --prefix not work for some reason? Did this error arise because even though the ipython kernel was installed locally, the kernel.json at the system directory still needs to be changed?

  2. How can I create a kernel truly locally? I suppose after that I can create my own kernel.json as in here or here to direct the jupyter notebook to use my own kernel?

Any help is highly appreciated! Thanks a lot in advance!

takluyver commented 6 years ago

If you're installing it in an environment, you probably don't want the --user flag. That flag means 'install this in the home directory of the current user'.

The error message is kind of confusing in this case. I think it says that on any permission error, regardless of what options you used. Trying to write 'helpful' error messages is really hard, because there are so many different ways to use software.