悬赏100请教linux安装python3

查看 102|回复 10
作者:jiangyi   
[ol]# uname -a
Linux lnas0b4d 4.4.18-g8bcbd8a-dirty #172 SMP Thu Jun 18 15:45:32 CST 2020 aarch64 GNU/Linux[/ol]复制代码
联想个人云A1 linux系统,带python2 需要安装python3
请高手指点,100元不成敬意
TG @wudaima

敬意, 请高手, 代码

jiangyi
OP
  
感谢https://t.me/zixunshi,真高手,搞定了
交配交的人   
这神仙也是买来的吧
若志   
TG发你了
ddzyx   
https://www.bt.cn/new/download.html  装完宝塔自带各种版本的python3
zhouktv1   
   
chatgpt解忧愁
[ol]To install Python 3 on a Linux system, you can follow these general steps. The specific commands may vary slightly depending on your distribution. Here, I'll provide instructions for installing Python 3 on a Debian-based system using `apt`, and on a Red Hat-based system using `yum`. Since you're using a custom Linux distribution on an ARM architecture (aarch64), some steps may require slight adjustments.
### For Debian-based systems (Ubuntu, Debian, etc.)
1. **Update the package list**:
   ```bash
   sudo apt update
   ```
2. **Install Python 3**:
   ```bash
   sudo apt install python3
   ```
3. **Verify the installation**:
   ```bash
   python3 --version
   ```
### For Red Hat-based systems (CentOS, Fedora, etc.)
1. **Update the package list**:
   ```bash
   sudo yum update
   ```
2. **Install Python 3**:
   ```bash
   sudo yum install python3
   ```
3. **Verify the installation**:
   ```bash
   python3 --version
   ```
### For Custom Linux Distributions or ARM Architecture
Since you're on a custom Linux distribution on an ARM architecture, you might need to build Python from source:
1. **Install necessary build tools and dependencies**:
   ```bash
   sudo apt update
   sudo apt install build-essential libssl-dev libffi-dev zlib1g-dev
   ```
2. **Download the latest Python 3 source code**:
   ```bash
   wget https://www.python.org/ftp/python/3.10.4/Python-3.10.4.tgz
   tar -xf Python-3.10.4.tgz
   cd Python-3.10.4
   ```
3. **Configure the build environment**:
   ```bash
   ./configure --enable-optimizations
   ```
4. **Build and install Python 3**:
   ```bash
   make -j 4  # Adjust the number based on your CPU cores
   sudo make altinstall
   ```
5. **Verify the installation**:
   ```bash
   python3.10 --version
   ```
### Additional Steps (if needed)
- **Create a symbolic link** (optional if you want to use `python3` as a command):
  ```bash
  sudo ln -s /usr/local/bin/python3.10 /usr/bin/python3
  ```
- **Install `pip` for Python 3**:
  ```bash
  sudo apt install python3-pip
  ```
These instructions should help you install Python 3 on your system. If you encounter any issues or need specific adjustments, feel free to ask![/ol]复制代码
jiangyi
OP
  

交配交的人 发表于 2024-5-24 23:18
这神仙也是买来的吧

朋友 , 求助, 联系一下我呗
jiangyi
OP
  
继续求救, 论坛的朋友都很热情  
BigBug   
装个宝塔面板 一键安装的  然后就可以随便安装版本了
jiangyi
OP
  
重点是没有编译器
您需要登录后才可以回帖 登录 | 立即注册

返回顶部