Bash scripts for creating a Python virtual environment with pyenv and venv.
For installing pyenv, run the following command:
./install-pyenv.sh
This command will check if pyenv's code is already downloaded in your $HOME directory, and if the configuration was added in .bashrc and .profile (if exists) files.
If the code was not downloaded, the program will download it. And if the configuration was not set, it will be.
For creating a new virtual environment using venv, run the following command:
source ./create-venv.sh <python-version> [<requirements-file>]
If a virtual environment in a venv
folder already exists, this command
will delete it and replace it with the new environment.
It's assumed that you have pyenv already installed in your computer.
For example:
source ./create-venv.sh 3.10.4
Requirements files are optional, and you can list as many requirements files as you want.
After running the previous command, the environment will be activated. For deactivating it, run:
deactivate