How to install Jupyter Notebook on Fedora using miniconda/anaconda

Documenting this now so future me does not need to spend an entire day figuring out how to install jupyter notebook on linux. Hopefully this will be useful for anyone searching on the internet

I was originally going to post this in the small linux problem thread, but it was a long post and I decided this is worth its own thread. Not so much a problem now that I figured it out. but I kept running into this issue when trying to use conda.

conda create WARNING: A directory already exists at the target location '/usr' but it is not a conda environment. Continue creating environment (y/[n])? y   
CondaValueError: either -n NAME or -p PREFIX option required, try "conda create -h" for more details

I couldn’t figure out how to solve this issue, instead of looking up how to install conda, I instead nuked my fedora installation and reinstalled to fedora 31

later when I reinstalled fedora I ran into the issue again, but this time I didn’t install conda. So after spending a day reinstalling Fedora, I decided to look up how to install conda

https://docs.conda.io/projects/conda/en/latest/user-guide/install/linux.html
this page was the solution.

  1. download the installer .sh files
  2. get to the directory where you downloaded the installer files
    • I found it easier to use the explorer to the directory right click open this in terminal
  3. run the bash commands
bash Miniconda3-latest-Linux-x86_64.sh
// or if you need anaconda
bash Anaconda-latest-Linux-x86_64.sh
  1. run the command for initializing conda for fish (if you use fish)
conda init fish

boom now you have conda installed.
5. Now that you have anaconda/miniconda installed, you can run the following command to install jupyter notebook

conda install jupyter
  1. Bonus installing pandas. Jupyter and python is pretty bare if you don’t have any libraries for data analysis. Lets install pandas. In any terminal you want/have init conda, run the following command
conda install pandas 
3 Likes

For whatever reason, Jupyter doesn’t have a native autocomplete
I found some good suggestions here

all the instructions here are from the stack overflow page

If you are looking for a more traditional autocomplete where the autocomplete tells you what the function does and the parameters needed, try hinterland.

Hinterland Install Instructions

Run this command in either fish or in your regular terminal, it will install a extensions tab into your file browser page of jupyter

conda install -c conda-forge jupyter_nbextensions_configurator

from there, open the menu and use it to enable hinterland in the nbextensions tab


you could also run this command to enable hinterland

jupyter nbextension enable hinterland/hinterland

I am using tabnine, which uses deep-learning for autocompletion, it doesn’t have the descriptions like hinterland, but it is better at noticing trends, which is nice if you want to avoid copy pasting and editing the copies.

Tabnine Install instructions from the author

pip3 install jupyter-tabnine
jupyter nbextension install --py jupyter_tabnine
jupyter nbextension enable --py jupyter_tabnine
jupyter serverextension enable --py jupyter_tabnine
1 Like

Another great option to use Jupyter is via Visual Studio Code. It comes with autocomplete built in, can display plots and most of the other things you’d want from jupyter. Best of all VS Code plays nicely with git and debuggers because it uses plain python files rather than special notebooks.

1 Like

Handy AF.

Been there done that (not with Fedora tho).

2 Likes

A bit of a necro but given that JupyterLab is supposed to take the place of Jupyter notebooks I think it stands to point out, that a sizable chunk of the solutions for linting or completion don’t seem to work anymore.
I did find jupyterlab-lsp though which I hope will let me use what I have in place for vim but if anyone else has Lab running, it would be nice to hear from them and their setup.

2 Likes

I use anaconda-navigator it works on Fedora 31… Screenshot_2020-02-18_02-18-07

I’m looking into creating a shortcut for launching it if I get around to using it more. I bounce between tools of late.

Interesting.
Looks good for people who have never used terminal before.

Though I still prefer my method because setting the directory is easier if I have multiple drives. By default, jupyter launches in your home directory, which is nice if you have all your projects there.

1 Like