wget https://www.python.org/ftp/python/3.8.5/Python-3.8.5.tgz
1.安装依赖
apt-get -y install gcc automake autoconf libtool make
apt-get -y install make*
apt-get -y install zlib*
apt-get -y install openssl libssl-dev
apt-get install sudo
2.进入/usr/local 目录,将安装包存放在此目录
apt-get install wget
cd /usr/local
wget https://www.python.org/ftp/python/3.8.5/Python-3.8.5.tgz
3.解压包,创建文件加,进入解压后的文件目录
tar -xvf Python-3.8.5.tgz
mkdir python3
cd Python-3.8.5
4.配置安装路径
./configure --prefix=/usr/local/python3 --enable-optimizations
make && make install
5.创建软连接
ln -s /usr/local/python3/bin/python3.8 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
#如果pip3安装失败可以尝试(apt-get install python3-pip)
6.至此一切python环境准备就绪(可使用-V命令查看版本信息)
又及:如果仍然不能使用pip3安装python的三方库,建议推倒重试一次
redis安装
下载redis
apt-get install redis
找到redis安装位置
whereis redis
安装redis-server和redis-cli
apt-get install redis-server
apt-get install redis-cli
后台运行redsi-server(通过配置文件运行,daemonize属性默认为yes)
redis-server& redis.conf
查看当前redis进程
apt-get install procps
ps -ef | grep redis
pip3 install -U scikit-learn -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
pip3 install flask_cors -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
pip3 install sqlalchemy -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
pip3 install pymysql -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
pip3 install pandas -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
pip3 install matplotlib -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
pip3 install scikit-learn -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
pip3 install scipy -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com