CentOS7上搭建httpbin环境
1、安装python3
1)安装python3.6可能使用的依赖
yum -y install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel
2)到python官网找到下载路径, 用wget下载
wget https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tgz
3)解压tgz包
tar -zxvf Python-3.6.4.tgz
4)把python移到/usr/local下面
mv Python-3.6.4 /usr/local/
5)删除旧版本的python依赖
ll /usr/bin | grep python
rm -rf /usr/bin/python
6)进入python目录
cd /usr/local/Python-3.6.4/
7)配置
./configure
8)编译,安装
make && make install
9)删除旧的软链接,创建新的软链接到最新的python
#rm -rf /usr/bin/python
ln -s /usr/local/bin/python3.6 /usr/bin/python
python -V
2、安装pip
cd /usr/local/src
wget https://pypi.python.org/packages/32/67/572f642e6e42c580d3154964cfbab7d9322c23b0f417c6c01fdd206a2777/pip-10.0.0b2.tar.gz#md5=cbfc1208d00bb72aba19431a7bb4afd5
tar -zxvf pip-10.0.0b2.tar.gz
cd pip-10.0.0b2
python setup.py install
3、安装其他包
1)安装:pip install gunicorn
2)安装:pip install httpbin
3)启动:gunicorn httpbin:app
原文地址:https://www.cnblogs.com/NiceTime/p/9192855.html