简体   繁体   中英

What is the difference between these two Python Notebooks in Jupyter?

Background

I'm a data analyst setting up a new data environment to perform analysis using Python in Jupyter notebooks.

I have installed miniconda on mac, and used it to create an environment called myenv . Inside there I have installed Jupyter using conda (system info below contains versions and builds).

Main question

When I launch a Jupyter notebook from terminal with jupyter notebook , and select new , I have two options to create a new notebook ( in this screenshot ).

Python 3 and Python 3.7.4 64-bit ('base': conda)

What is the difference between these options, and which should I use to create the notebook?

Extra info

My intention is to setup a conda data environment containing all of the packages needed for data analysis (and no extra), which is easy to replicate if other analysts onboard or join in working on the same piece.

I appreciate this is hopefully a very simple question - I'd be grateful of any suggested articles to help understand the setup process.

Thank you!

Jack

System info

  • macOS Mojave - Version 10.14.6
  • miniconda installation - conda 4.8.2
  • conda environment myenv (created with conda create --name myenv ) containing:

    • python version 3.8.1
    • jupyter (installed with conda install jupyter ) - version 1.0.0 build py38_7
    • jupyter_client - version 5.3.4 build py38_0
    • jupyter_console - version 6.1.0 build py_0
    • jupyter_core - version 4.6.1 build py38_0

This is always confusing when you work with environments. One work around and good way is to link the environment with kernel.

After you activated the environment in the terminal, use these two commands(need to do it only once you create the environment):

conda install ipykernel
python -m ipykernel install --user --name=env_name

write name of environment created instead of env_name above.

Then whenever you want to open new notebook, you can see an extra option which says your environment and you can use that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM