From c34cfc4c7818ea2020cb01b502a61eec6d26bfc3 Mon Sep 17 00:00:00 2001 From: ebner Date: Wed, 2 Jul 2025 12:18:53 +0200 Subject: [PATCH] update readme --- Readme.md | 80 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 48 insertions(+), 32 deletions(-) diff --git a/Readme.md b/Readme.md index 228575c..f447605 100644 --- a/Readme.md +++ b/Readme.md @@ -7,8 +7,54 @@ https://github.com/pyenv/pyenv Ideas for RPM packaging: https://github.com/niligulmohar/pyenv-rpm -# Development +# Usage +Use pyenv: +```bash +# show installed versions +pyenv versions +# show current python version +pyenv version +# show possible python versions to install +pyenv install --list +# install a python version +pyenv install + +# activate python version for current shell: +pyenv shell + +# uninstall python version +pyenv uninstall + +# create a python environment +pyenv virtualenv + +# activate virtual environment in current shell +pyenv shell + +# remove virtualenv +pyenv virtualenv-delete +``` + + +*INFO: Somehow `pyenv local` does not work (i.e. switching python version based on directory!)* + +Tutorial: https://realpython.com/intro-to-pyenv + + +# Installation +Install the rpm to get pyenv on the system. Afterwards you can bring/initialize pyenv into your shell via: + +```bash +export PYENV_ROOT="$HOME/.pyenv" +[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH" +eval "$(pyenv init -)" +``` + +To initialize for all users you might want to add a bash profile file to `/etc/profile.d` like this one: [pyenv.sh](pyenv.sh) + +# Development +# Manual Bild ``` docker run --platform linux/amd64 -it --rm -v $(pwd):/data --workdir /data gitea.psi.ch/images/rhel9-developer @@ -16,7 +62,7 @@ rpmbuild -ba pyenv.spec ``` -# Installation +# Manual Installation See: https://gitea.psi.ch/linux/issues/issues/327#issuecomment-22876 and https://github.com/pyenv/pyenv @@ -59,34 +105,4 @@ Installation virtualenv plugin (https://github.com/pyenv/pyenv-virtualenv): git clone https://github.com/pyenv/pyenv-virtualenv.git /opt/pyenv/plugins/pyenv-virtualenv ``` -Use pyenv: -```bash -# show installed versions -pyenv versions -# show current python version -pyenv version -# show possible python versions to install -pyenv install --list -# install a python version -pyenv install -# activate python version for current shell: -pyenv shell - -# uninstall python version -pyenv uninstall - -# create a python environment -pyenv virtualenv - -# activate virtual environment in current shell -pyenv shell - -# remove virtualenv -pyenv virtualenv-delete -``` - - -*INFO: Somehow `pyenv local` does not work (i.e. switching python version based on directory!)* - -Tutorial: https://realpython.com/intro-to-pyenv