This script automates the creation of a Conda virtual environment, installs the necessary packages, and registers the environment with Jupyter.
- Create Conda Environment: Automatically create a new Conda environment with a specified name and Python version.
- Install ipykernel: Install the ipykernel package in the environment to enable Jupyter integration.
- Jupyter Integration: Register the newly created environment as a kernel in Jupyter with a custom display name.
- Safety Checks: Ensures that the specified Python version is available and that the environment does not already exist.
git clone https://github.com/syd168/condaEnvTool.git
cd condaEnvTool
- Conda: Ensure Conda is installed and properly configured. The script assumes Conda is located at
~/workspace/anaconda3
. Modify theCONDA_PATH
variable if necessary.
-
Make the Script Executable:
chmod +x mkenv.sh rmenv.sh
-
Execute the Script:
./mkenv.sh <env_name> <python_version>
<env_name>
: The name of the Conda environment to create.<python_version>
: The Python version for the environment (e.g., 3.8, 3.9).
-
Remove the Conda environment and its corresponding Jupyter Notebook kernel.:
./rmenv.sh <env_name>
<env_name>
: The name of the Conda environment to create.
./mkenv.sh myenv 3.9
./rmenv.sh myenv