If you are testing programmes or developping your own I strongly suggest to look after an environment manager. An easy way to install libraries into dedicated environments in isolation from each other, and to keep track of what is installed where. A whildely used environment manager is conda
Install on Windows
Before reading this post, I suggest you follow Ubuntu on Windows (WSL).
- Open 'Ubuntu'
- Download Miniconda installer for Linux
wget https://repo.anaconda.com/miniconda/Miniconda3-py39_4.12.0-Linux-x86_64.sh
- Install miniconda
bash Miniconda3-py39_4.12.0-Linux-x86_64.sh
- Press
Enter
to continue - Press
Space
to read through the licence - Key 'yes' to accept the licence
- Press
Enter
to install miniconda3 - Key 'yes' to confirm installation
- Quit and restart 'Ubuntu'
At this point you will find a new information in your prompt that indicate in which conda environment you are currently in.
Install on MacOS
Before reading this post, I suggest you follow Improved Shell (MacOS).
- Open 'Terminal'
- Install miniconda from Homebrew
brew install --cask miniconda
- Configure conda for zsh
/opt/homebrew/bin/conda init zsh
- Quit and restart 'Terminal'
At this point you will find a new information in your prompt that indicate in which conda environment you are currently in.
Usage
- Update conda
conda update -n base -c defaults conda
- Create a new environment
conda create -n myEnvName
- Activate the environment
conda activate myEnvName
conda install ...
pip install ...
- List all libraries in the current environment
conda list
- Exit an environment
conda deactivate
- Remove an environment
conda env remove -n myEnvName
- List the environements available
conda env list
Next, I suggest you follow Cross Platform, Cross Language Text Editor - VSCode.
Top comments (0)