# 配置pip 源
mkdir -p ~/.pip && cat >> pip.conf <<EOF [global] timeout = 60 index-url = https://pypi.doubanio.com/simple EOF
# pyenv 安装
Centos 所需依赖: yum install gcc zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel make patch gdbm-devel
# Kali 版本安装依赖包
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
$ curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash
Or
$ curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
2020.03.11 update # curl https报错: curl: (35) SSL connect error
yum -y update nss
ldconfig
vim ~/.bashrc 写入下面内容,source ~/.bashrc
export PATH="/home/loki/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
2020.03.11 update # ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?
安装python3.7.x及以上版本要注意ssl模块依赖openssl 1.0.2或者1.1以上版本,如果openssl版本低于以上版本,将无法正常安装python3.7.x 的ssl模块.
sudo wget https://www.openssl.org/source/openssl-1.0.2r.tar.gz
sudo tar -xzvf openssl-1.0.2r.tar.gz
cd openssl-1.0.2r
sudo ./config --prefix=/usr --openssldir=/usr/openssl shared zlibs
sudo ./config --prefix=/usr --openssldir=/usr/openssl shared
sudo make
sudo make install
# Python搭建建议的web
## Python3
python -m http.server <端口号>
## python2
python -m SimpleHTTPServer <端口号>