images\cherry_red.png1 Python
      images\cherry_blue.png1.1 爬虫
         images\cherry_orange.png1.1.1 多线程
         images\cherry_orange.png1.1.2 B站
         images\cherry_orange.png1.1.3 zmq71多线程爬取
         images\cherry_orange.png1.1.4 jable.tv多线程爬取
            images\cherry_cyan.png1.1.4.1 jable.tv细节
         images\cherry_orange.png1.1.5 python执行js代码
         images\cherry_orange.png1.1.6 windows代理配置
      images\cherry_blue.png1.2 Linux编译升级3.9版本
      images\cherry_blue.png1.3 数据分析
         images\cherry_orange.png1.3.1 预测考研成绩
   images\cherry_red.png2 Python django
      images\cherry_blue.png2.1 目录层面说明
         images\cherry_orange.png2.1.1 urls.py
         images\cherry_orange.png2.1.2 settings.py
         images\cherry_orange.png2.1.3 M 模型数据库
         images\cherry_orange.png2.1.4 T templates/...html
         images\cherry_orange.png2.1.5 V(逻辑处理) views.py
      images\cherry_blue.png2.2 django模板
         images\cherry_orange.png2.2.1 模板标签
            images\cherry_cyan.png2.2.1.1 过滤器
            images\cherry_cyan.png2.2.1.2 标签
               images\cherry_orange_dark.png2.2.1.2.1 if/else
               images\cherry_orange_dark.png2.2.1.2.2 for
               images\cherry_orange_dark.png2.2.1.2.3 ifequal/ifnotequal
               images\cherry_orange_dark.png2.2.1.2.4 csrf_token
            images\cherry_cyan.png2.2.1.3 模板继承
         images\cherry_orange.png2.2.2 自定义标签和过滤器
      images\cherry_blue.png2.3 django模型ORM
         images\cherry_orange.png2.3.1 App应用
            images\cherry_cyan.png2.3.1.1 models.py
         images\cherry_orange.png2.3.2 SQL
            images\cherry_cyan.png2.3.2.1 新增
            images\cherry_cyan.png2.3.2.2 删除
            images\cherry_cyan.png2.3.2.3 更新
            images\cherry_cyan.png2.3.2.4 查询
         images\cherry_orange.png2.3.3 单表示例
         images\cherry_orange.png2.3.4 多表示例
         images\cherry_orange.png2.3.5 聚合查询
         images\cherry_orange.png2.3.6 分组查询
      images\cherry_blue.png2.4 django表单
         images\cherry_orange.png2.4.1 GET
         images\cherry_orange.png2.4.2 POST
         images\cherry_orange.png2.4.3 Request
      images\cherry_blue.png2.5 django视图
      images\cherry_blue.png2.6 django路由
      images\cherry_blue.png2.7 django Admin管理
      images\cherry_blue.png2.8 django组件
         images\cherry_orange.png2.8.1 Form页面组件
         images\cherry_orange.png2.8.2 Auth用户认证
         images\cherry_orange.png2.8.3 Cookie/Session
         images\cherry_orange.png2.8.4 中间件
         images\cherry_orange.png2.8.5 视图FBV/CBV
      images\cherry_blue.png2.9 django+nginx+uwsgi
      images\cherry_blue.png2.10 Python小知识
         images\cherry_orange.png2.10.1 def __int__(self):
         images\cherry_orange.png2.10.2 def __str__(self):
         images\cherry_orange.png2.10.3 @staticmethod
         images\cherry_orange.png2.10.4 @wraps
         images\cherry_orange.png2.10.5 pycharm
1,下载安装包,选择对应系统的版本
https://www.python.org/downloads/source/

我想安装配置Linux配置Python3.9版本
images\7-1.png


下载完成后,将文件上传到服务器上面即可,建议新创建一个文件夹



更新Linux系统编译依赖环境,谨慎升级!防止其他服务依赖影响!

Ubuntu
sudo apt update
sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev curl libbz2-dev liblzma-dev
sudo apt install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make

centos
yum update
yum -y install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev curl libbz2-dev liblzma-dev
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make


配置SSL证书
方法一,直接升级即可
Ubuntu
sudo yum -y install openssl

centos
sudo yum -y install openssl


方法二,编译安装,注意请备份!
下载 wget http://www.openssl.org/source/openssl-1.1.1g.tar.gz

编译 tar -xvf openssl-1.1.1g.tar.gz && cd openssl-1.1.1g && ./config --prefix=/usr/local/openssl && make && make install

备份
mv /usr/bin/openssl /usr/bin/openssl_bak
mv /usr/include/openssl /usr/include/openssl_bak

软连接
ln -s /usr/local/openssl/include/openssl /usr/include/openssl
ln -s /usr/local/openssl/lib/libssl.so.1.1 /usr/local/lib64/libssl.so
ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl
echo "/usr/local/openssl/lib" >> /etc/ld.so.conf
ldconfig -v


编译安装Python3.9 在该目录下
tar -zxvf Python-3.9.16.tgz
cd Python-3.9.16.tgz
./configure --prefix=/usr/local/python3.9 --with-ssl
make && make install

若遇到该问题请看
zlib1g-dev is already installed but shows ModuleNotFoundError: No module named 'zlib'
https://stackoverflow.com/questions/64708939/zlib1g-dev-is-already-installed-but-shows-modulenotfounderror-no-module-named

创建软连接
ln -s /usr/local/python3.9/bin/python3.9 /usr/local/bin/python3.9
ln -s /usr/local/python3.9/bin/pip3.9 /usr/local/bin/pip3.9


安装或更新包的时候,出现SSL证书不对的问题,请升级SSL,参考配置SSL证书方法等
pip3.9 install xxx
pip3.9 install xxx --upgrade