Closed Proteusiq closed 2 months ago
#!/bin/bash
create_virtualenvs() {
# virtual environment directories and their respective packages
declare -A envs
envs["$HOME/.virtualenvs/neovim"]="pynvim"
envs["$HOME/.virtualenvs/debugpy"]="pynvim debugpy"
# create .virtualenvs directory if it doesn't exist
mkdir -p "$HOME/.virtualenvs"
# for each environment check existence and install
for env in "${!envs[@]}"; do
# create it if not exist
if [ ! -d "$env" ]; then
python -m venv "$env"
fi
# upgrade pip and install the required packages
"$env/bin/pip" install --upgrade pip
"$env/bin/pip" install --upgrade ${envs[$env]}
done
echo "🔥 Virtual environments and 📦 packages installed."
}
# Call the function
create_virtualenvs
Did not use uv because of pip. uv needs pip ensure but also it is a small installation
/.virtualenvs