Created
March 2, 2021 14:15
-
-
Save andyeff/94e23985c3edda9b262b7c06b6f8e009 to your computer and use it in GitHub Desktop.
Configuring Pyenv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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! | |
--- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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!