Skip to content

Instantly share code, notes, and snippets.

@y2k-shubham
Forked from ysaotome/install_pyenv.sh
Created January 4, 2019 11:17
Show Gist options
  • Save y2k-shubham/ddd6d856ec997e9bb55be272af82393b to your computer and use it in GitHub Desktop.
Save y2k-shubham/ddd6d856ec997e9bb55be272af82393b to your computer and use it in GitHub Desktop.
pyenv install for CentOS 6.5 x86_64
#!/bin/zsh
# pyenv install for CentOS 6.5 x86_64
yum install -y gcc gcc-c++ make git patch openssl-devel zlib-devel readline-devel sqlite-devel bzip2-devel
git clone git://github.com/yyuu/pyenv.git ~/.pyenv
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
cat << _PYENVCONF_ >> ~/.zshrc
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
_PYENVCONF_
pyenv install 2.7.6
pyenv versions
pyenv shell 2.7.6
pyenv global 2.7.6
pyenv versions
pyenv rehash
@y2k-shubham
Copy link
Author

If pyenv goes out-of-path, add this line in ~/.zshrc / ~/.bashrc / ~/.bash_profile
export PATH="$HOME/.pyenv/bin:$PATH"

@y2k-shubham
Copy link
Author

at least these two lines are very important (do add in ~/.bashrc or ~/.zshrc)
otherwise even though your'e able to set python versions, using pyenv local 3.x.x, it has no impact

export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"

@y2k-shubham
Copy link
Author

also do yum install -y libffi-devel
https://stackoverflow.com/a/48045929/3679900

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