Skip to content

Instantly share code, notes, and snippets.

@andyeff
Created March 2, 2021 14:15
Show Gist options
  • Save andyeff/94e23985c3edda9b262b7c06b6f8e009 to your computer and use it in GitHub Desktop.
Save andyeff/94e23985c3edda9b262b7c06b6f8e009 to your computer and use it in GitHub Desktop.
Configuring Pyenv
---
Installing pyenv for arbitrary python version development
# create a user, add to sudoers
useradd andy
visudo # do changes
su - andy
sudo dnf -y install make gcc zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel tk-devel libffi-devel
curl https://pyenv.run | bash
# add the following to .bashrc
export PATH="/home/afogg/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
# exit and re-su
su - andy
sudo mount -o remount,exec /tmp # needed if working on a hardened RHEL instance
pyenv install 3.8.3
# list possible pythons
pyenv versions
# set 3.8.3
pyenv global 3.8.3
# create a virtualenv
pyenv virtualenv venv
pyenv activate venv
# Do work!
---
@andyeff
Copy link
Author

andyeff commented Mar 2, 2021

Yes line 10 is awful but it's the way the author suggests it is installed (and I was busy today and needed this up and running quick). Feel free to do something a little more secure for your own needs, if required!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment