linux服务器部署python环境

一、安装python3运行环境
1、下载安装包
wget http://cdn.npm.taobao.org/dist/python/3.6.5/Python-3.6.5.tgz
2.解压压缩包
tar -zxvf Python-3.6.5.tgz
3、进入安装文件夹
cd Python-3.6.5
4、增加配置
./configure --prefix=/usr/local/python3
5、安装
make make install
6、准备编译环境(非必须)
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc* make -y
7、创建软链接(非必须)
在/usr/bin目录创建/usr/local/python3/bin/python3文件的软链接 ln -s /usr/local/python3/bin/python3 /usr/bin/python3
二、安装pip3
8、安装pip3
wget https://bootstrap.pypa.io/get-pip.py
python3 get-pip.py
9、给pip3创建软链接
ln -n /usr/local/python3/bin/pip /usr/bin/pip3
三、利用pip3安装其他依赖包
10、安装其他依赖包
pip3 install xgboost -i  https://pypi.tuna.tsinghua.edu.cn/simple/

posted @ 2021-12-15 20:04  The-Chosen-One  阅读(556)  评论(0编辑  收藏  举报