【python】Linux升级版本

目的

迁移项目包路径到服务器上

查看服务器包是否和本地已有项目python版本相同然后发现~嗯不一样

项目上包时用的3.8~

服务器用的2.7

查看方法:

bash 复制代码
python -version

解决方案

一:项目所有包重新下载

二:升级服务器python版本

第二种步骤:

a. 更新包

bash 复制代码
sudo apt update

成功报错;

这个是啥额》简单说就是你机器没安装git

liunx 服务器安装git

如何安装:

Linux系统分为两种:

  • RedHat系列,包含Redhat、Centos、Fedora等

    RedHat系列的包管理工具是yum,

  • Debian系列,包含Debian、Ubuntu等

    Debian系列的包管理工具是apt-get

怎么知道自己什么系列:

查看:

bash 复制代码
cat /proc/version

接下来继续升级

bash 复制代码
sudo apt update
sudo apt install python3.8.0
sudo apt install python3.8.0-venv python3.8.0-dev
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8.0
python3 --version
相关推荐
你好潘先生5 小时前
别再记命令了,用 yeero do 说句人话就能跑脚本,而且不烧 token
服务器·python·命令行
Agent_大师5 小时前
WebSocket 行情重连成功,K线缺口不会自动消失
python
荣码5 小时前
LLM结构化输出:让AI返回JSON而不是废话,我踩了4个坑
java·python
copyer_xyf6 小时前
FastAPI 如何连接 MySQL
后端·python
orion5717 小时前
Missing Semester Class1:course overview and introduction of shell
linux
apocelipes19 小时前
常用编程语言和库的正则表达式性能对比
c语言·c++·python·性能优化·golang·开发工具和环境
用户83562907805121 小时前
使用 Python 在 PDF 中创建与管理书签
后端·python
用户120487221611 天前
Linux驱动编译与加载
linux·嵌入式
MeixianAgent1 天前
Python 回测数据入口怎么验?历史 K 线入库前先做 5 个检查
后端·python
咕白m6251 天前
用 Python 实现一键批量查找与替换 Excel 数据
后端·python