linux安装python的步骤

最近买了一台云服务器,这是我目前买的第三台云服务器。我习惯用ubuntu系统,所以就安装了ubuntu22.4版本。现在记录一下怎么在linux下安装python。

因为我买的是轻量型服务器,自己私下玩一下linux

ubuntu安装miniconda

步骤 1: 下载Miniconda安装脚本

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh

image-20240920093329482

步骤 2: 安装Miniconda

一旦下载完成,就可以开始安装Miniconda了:

bash Miniconda3-latest-Linux-x86_64.sh

步骤 3: 配置环境变量

source ~/.bashrc

如果安装成功,可以通过运行以下命令来验证:

conda --version

image-20240920093656862

安装一些常用的库

比如numpy、pillow、gdal

conda install numpy pillow gdal 

image-20240920093758261

验证一下是否安装成功

image-20240920093924035