Skip to content

Instantly share code, notes, and snippets.

@anil-kk
Last active September 11, 2023 20:54
Show Gist options
  • Save anil-kk/d5377774ef3daa9a91b2e49b1ca63336 to your computer and use it in GitHub Desktop.
Save anil-kk/d5377774ef3daa9a91b2e49b1ca63336 to your computer and use it in GitHub Desktop.
Create new conda environment and add the kernel to JupyterServer

Create new conda environment and add the kernel to existing jupyterlab

  • conda create -n my_env python=3.10
  • conda activate my_env
  • conda install jupyter
  • which python (should point to the one from new environment)
  • python -m ipykernel install --user --name="my_env" --display-name="my_env (Python 3.10)"
  • jupyter kernelspec list
  • !python3 -m jupyter kernelspec list (from notebook cell)

installing new module from terminal

  • conda install -c conda-forge ydata-profiling -n my_env
Display the source blob
Display the rendered blob
Raw
{
"metadata": {
"name": "install module via notebook"
},
"nbformat": 2,
"worksheets": [
{
"cells": [
{
"cell_type": "markdown",
"source": [
"Install model if not found"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"try:",
" from ydata_profiling import ProfileReport",
"except:",
" print(\"Module does not exist! installing...\")",
" import sys",
" !{sys.executable} -m pip install ydata-profiling"
],
"language": "python",
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"DONE!"
]
}
],
"prompt_number": 3
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment