Linux常见的问题
记录了Linux下常见的环境配置问题,长期更新。
大多数情况下请合理配置代理以获得更快的下载速度。
export https_proxy=http://192.168.20.238:7890 http_proxy=http://192.168.20.238:7890 all_proxy=socks5://192.168.20.238:7890
pyenv环境配置
Ubuntu
curl https://pyenv.run | bash
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev liblzma-dev python-openssl git
Centos
curl https://pyenv.run | bash
yum install zlib-devel openssl-devel sqlite-devel patch yum-utils bzip2-devel xz-devel ncurses-devel libffi-devel readline-devel sqlite-devel
yum-builddep python3
配置环境
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile
pyenv init
pyenv init 2>> ~/.bashrc
source ~/.bash_profile
常用命令
pyenv install -l
pyenv install 3.8
pyenv versions
pyenv local 3.6.9
pyenv global 3.6.9