一开始用官网的安装步骤,因国外的网址等各种安装失败,偶发现这个安装步骤,亲试可以安装,步骤留存:
sudo yum install libffi-devel -y # 编译python前安装
sudo yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel -y
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
或者
git clone https://gitee.com/attaboy_1105/pyenv.git ~/.pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n \
eval "$(pyenv init -)"\nfi' >> ~/.bashrc
exec bash
mkdir -p ~/.pyenv/cache
wget -c -O ~/.pyenv/cache/Python-3.7.5.tar.xz \
https://npm.taobao.org/mirrors/python/3.7.5/Python-3.7.5.tar.xz
~/.pyenv/bin/pyenv install -v -f 3.7.5
~/.pyenv/bin/pyenv global 3.7.5
exec bash
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
pip install --upgrade pip
pip install requests mysqlpy paramiko ipython numpy scipy opencv-python open3d sanic sanic_cors