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...
#8
(Sep-15-2023, 03:58 PM)snippsat Wrote:
(Sep-14-2023, 06:29 PM)bytecrunch Wrote: However, without creating a jupyter kernel specific for that environment via:
You don't install a jupyter kernel as mention this is done automatic when install JupyterLab
Here how i like to make a environment,make sure that use channel conda-forge and install a new Python 3.11.4 to this environment.
Make sure all is up to date before making environment conda update --all
conda create --name home_env -c conda-forge spyder jupyterlab pandas python=3.11.4
Now if activate home_env and test:
C:\anaconda3
(base) λ activate home_env

C:\anaconda3
(home_env) λ jupyter --version
Selected Jupyter core packages...
IPython          : 8.15.0
ipykernel        : 6.25.0
ipywidgets       : not installed
jupyter_client   : 7.4.9
jupyter_core     : 5.3.0
jupyter_server   : 1.23.4
jupyterlab       : 3.6.3
nbclient         : 0.5.13
nbconvert        : 6.5.4
nbformat         : 5.9.2
notebook         : 6.5.4
qtconsole        : 5.4.2
traitlets        : 5.7.1
See that ipykernel : 6.25.0 is installed.
If have trouble i would suggest to remove Anaconda and install the new version that are Python 3.11.


Hello snippsat,

I was re-reading your replies. thank you. Let me see if I understood correctly.

ISSUE: my issue was that, after creating a new virtual environment (ven1) and launching jupyter notebook from it (from the CLI of the activated environment), I notices that the notebook did NOT have access to the libraries/modules of (ven1) as I would have liked...

SOLUTIONS
There are two possible solutions:

1) Let's assume we already have Jupyter Notebook installed on our computer. We then create a virtual environment called (ven1). If we launch jupyter notebook from the command line of the activated environment, jupyter notebook will open but the notebook will NOT use the libraries and modules of (ven1), as we would instead like, just because the we opened the app from (ven1).
To solve that, we could install a new jupyter notebook inside (ven1) itself. At that point, when we type "jupyter notebook", the notebook will have access to (ven1) resources...That is redundant: having multiple jupyter notebooks, one for each environment, does not seem efficient.

2) The other and more efficient solution is to:
a) only keep a single Jupyter notebook installation
b) create the new virtual environment (ven1)
c) create a new jupyter kernel inside (ven1) with the steps described above (ipykernel, etc.).
d) after typing "jupyter notebook" at the CLI of activated (ven1), the notebook opens and we simply select the new jupyter kernel specific to (ven1) that we created for the notebook to have access to (ven1) resources...

Did I understand correctly? Thank YOU for your patience!
Reply


Messages In This Thread
RE: Jupyter notebooks, jupyter kernels, virtual environment created in Anaconda... - by bytecrunch - Nov-05-2023, 05:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Jupyter Notebook TypeError Holidays entity loader class bmanning20 0 2,846 Jul-20-2023, 06:52 PM
Last Post: bmanning20
  Why does graph look different in Codecademy and Jupyter Notebook abc123456 1 1,545 Mar-29-2023, 09:22 AM
Last Post: newbieAuggie2019
  Setting up and integrating Jupyter Notebook development environment with VSC Drone4four 3 2,027 Sep-12-2022, 09:18 AM
Last Post: Drone4four
  Jupyter:On my computer, where csv file is? Leloup 2 1,561 Mar-22-2022, 04:39 PM
Last Post: Leloup
Thumbs Up can't access data from URL in pandas/jupyter notebook aaanoushka 1 1,932 Feb-13-2022, 01:19 PM
Last Post: jefsummers
Exclamation Jupyter Notebook - Help Needed! eyadfr 1 1,916 Jan-26-2022, 06:42 PM
Last Post: jefsummers
  Help needed with Jupyter Notebook eyadfr 4 2,192 Jan-04-2022, 08:20 PM
Last Post: snippsat
  HELP! Importing json file into csv into jupyter notebook vilsef 2 2,660 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,473 Dec-22-2020, 07:04 PM
Last Post: C3PO
  Python Custom Module not working in Jupyter Notebook with Pandas fid 0 2,084 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