This commit is contained in:
@@ -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 <versions>
|
||||
|
||||
# activate python version for current shell:
|
||||
pyenv shell <version>
|
||||
|
||||
# uninstall python version
|
||||
pyenv uninstall <version>
|
||||
|
||||
# create a python environment
|
||||
pyenv virtualenv <version> <name>
|
||||
|
||||
# activate virtual environment in current shell
|
||||
pyenv shell <name>
|
||||
|
||||
# remove virtualenv
|
||||
pyenv virtualenv-delete <name>
|
||||
```
|
||||
|
||||
|
||||
*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 <versions>
|
||||
|
||||
# activate python version for current shell:
|
||||
pyenv shell <version>
|
||||
|
||||
# uninstall python version
|
||||
pyenv uninstall <version>
|
||||
|
||||
# create a python environment
|
||||
pyenv virtualenv <version> <name>
|
||||
|
||||
# activate virtual environment in current shell
|
||||
pyenv shell <name>
|
||||
|
||||
# remove virtualenv
|
||||
pyenv virtualenv-delete <name>
|
||||
```
|
||||
|
||||
|
||||
*INFO: Somehow `pyenv local` does not work (i.e. switching python version based on directory!)*
|
||||
|
||||
Tutorial: https://realpython.com/intro-to-pyenv
|
||||
|
||||
Reference in New Issue
Block a user