Python Forum
Jupyter notebooks, jupyter kernels, virtual environment created in Anaconda...
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Jupyter notebooks, jupyter kernels, virtual environment created in Anaconda...
#5
(Sep-14-2023, 01:02 PM)snippsat Wrote:
(Sep-14-2023, 11:56 AM)bytecrunch Wrote: Does choosing one kernel versus the other connect different environments to jupyter? Is that what is going on?
No the are speareted,so have to install eg JupyterLab(which also install the kernel),in each environment.
There had been little point in virtual environment if the shared stuff馃К.
Can do quick demo,here a have older my_env and newer new_env envroment.
C:\Anaconda3
(base) 位 activate my_env

C:\Anaconda3
(my_env) 位 jupyter --version
Selected Jupyter core packages...
IPython          : 8.9.0
ipykernel        : 6.21.1
ipywidgets       : not installed
jupyter_client   : 7.4.9
jupyter_core     : 5.2.0
jupyter_server   : 2.2.1
jupyterlab       : 3.6.1
nbclient         : 0.7.2
nbconvert        : 7.2.9
nbformat         : 5.7.3
notebook         : 6.5.2
qtconsole        : 5.4.0
traitlets        : 5.9.0

C:\Anaconda3
(my_env) 位 activate new_env

conda.bat activate new_env

C:\Anaconda3
(new_env) 位 jupyter --version
Selected Jupyter core packages...
IPython          : 8.14.0
ipykernel        : 6.23.1
ipywidgets       : not installed
jupyter_client   : 8.2.0
jupyter_core     : 5.3.0
jupyter_server   : 2.6.0
jupyterlab       : 4.0.1
nbclient         : 0.8.0
nbconvert        : 7.4.0
nbformat         : 5.9.0
notebook         : not installed
qtconsole        : not installed
traitlets        : 5.9.0

# Start JupyterLab from new_env
C:\Anaconda3
(new_env) 位 jupyter lab
So in browser can do.
import jupyterlab

jupyterlab.__version__
4.0.1
If i start JupyterLab for my_env it will show version 3.6.1.

For Editors/IDE most choice right environment,eg look at this post for VS Code.
If eg use Spyder you install it to the environment(do not use share one),then start if from command line spyder.

Also a tip try to use command line much to get comfortable with it,many time i just run code from command line in the environment and not involving a editor(of just use to view code).
Then it also help to have something a lot better than cmd/PowerShell like cmder(full)

Thank you snippsat! I fee like a have done what you describe in your examples. I have used the Anaconda terminal to:

a) create a new environment, (new_env)
b) install jupyter notebook inside of the environment itself
c) launched jupyter notebook from it which then opens up

However, without creating a jupyter kernel specific for that environment via:

(new_env) C:\Users\Brett\python_env\ conda install ipykernel # we install the package ipykernel inside the ven1 environment
(new_env) C:\Users\Brett\python_env\ ipython kernel install --user --name=ven1kernel # creates a new kernel
(new_env) (C:\Users\Brett\python_env\ jupyter kernelspec list #lists all jupyter kernels

then the jupyter notebook will NOT be able to access the modules inside the environment....correct?
Reply


Messages In This Thread
RE: Jupyter notebooks, jupyter kernels, virtual environment created in Anaconda... - by bytecrunch - Sep-14-2023, 06:29 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Jupyter Notebook TypeError Holidays entity loader class bmanning20 0 2,806 Jul-20-2023, 06:52 PM
Last Post: bmanning20
  Why does graph look different in Codecademy and Jupyter Notebook abc123456 1 1,526 Mar-29-2023, 09:22 AM
Last Post: newbieAuggie2019
  Setting up and integrating Jupyter Notebook development environment with VSC Drone4four 3 1,995 Sep-12-2022, 09:18 AM
Last Post: Drone4four
  Jupyter:On my computer, where csv file is? Leloup 2 1,535 Mar-22-2022, 04:39 PM
Last Post: Leloup
Thumbs Up can't access data from URL in pandas/jupyter notebook aaanoushka 1 1,910 Feb-13-2022, 01:19 PM
Last Post: jefsummers
Exclamation Jupyter Notebook - Help Needed! eyadfr 1 1,897 Jan-26-2022, 06:42 PM
Last Post: jefsummers
  Help needed with Jupyter Notebook eyadfr 4 2,180 Jan-04-2022, 08:20 PM
Last Post: snippsat
  HELP! Importing json file into csv into jupyter notebook vilsef 2 2,637 Jan-22-2021, 11:06 AM
Last Post: snippsat
  How can draw a real-time marker on map using folium/leaflet Jupyter notebook C3PO 0 2,457 Dec-22-2020, 07:04 PM
Last Post: C3PO
  Python Custom Module not working in Jupyter Notebook with Pandas fid 0 2,072 Jul-04-2020, 11:05 AM
Last Post: fid

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020