全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 1169|回复: 15

悬赏100请教linux安装python3

[复制链接]
发表于 2024-5-24 23:12:34 | 显示全部楼层 |阅读模式
  1. # uname -a
  2. Linux lnas0b4d 4.4.18-g8bcbd8a-dirty #172 SMP Thu Jun 18 15:45:32 CST 2020 aarch64 GNU/Linux
复制代码


联想个人云A1 linux系统,带python2 需要安装python3
请高手指点,100元不成敬意

TG @wudaima
 楼主| 发表于 2024-5-26 19:16:04 来自手机 | 显示全部楼层
感谢https://t.me/zixunshi,真高手,搞定了
发表于 2024-5-24 23:18:38 | 显示全部楼层
这神仙也是买来的吧
发表于 2024-5-24 23:20:39 | 显示全部楼层
https://www.bt.cn/new/download.html  装完宝塔自带各种版本的python3
发表于 2024-5-24 23:21:53 | 显示全部楼层
本帖最后由 zhouktv1 于 2024-5-24 23:23 编辑

chatgpt解忧愁

  1. 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.

  2. ### For Debian-based systems (Ubuntu, Debian, etc.)
  3. 1. **Update the package list**:
  4.    ```bash
  5.    sudo apt update
  6.    ```

  7. 2. **Install Python 3**:
  8.    ```bash
  9.    sudo apt install python3
  10.    ```

  11. 3. **Verify the installation**:
  12.    ```bash
  13.    python3 --version
  14.    ```

  15. ### For Red Hat-based systems (CentOS, Fedora, etc.)
  16. 1. **Update the package list**:
  17.    ```bash
  18.    sudo yum update
  19.    ```

  20. 2. **Install Python 3**:
  21.    ```bash
  22.    sudo yum install python3
  23.    ```

  24. 3. **Verify the installation**:
  25.    ```bash
  26.    python3 --version
  27.    ```

  28. ### For Custom Linux Distributions or ARM Architecture

  29. Since you're on a custom Linux distribution on an ARM architecture, you might need to build Python from source:

  30. 1. **Install necessary build tools and dependencies**:
  31.    ```bash
  32.    sudo apt update
  33.    sudo apt install build-essential libssl-dev libffi-dev zlib1g-dev
  34.    ```

  35. 2. **Download the latest Python 3 source code**:
  36.    ```bash
  37.    wget https://www.python.org/ftp/python/3.10.4/Python-3.10.4.tgz
  38.    tar -xf Python-3.10.4.tgz
  39.    cd Python-3.10.4
  40.    ```

  41. 3. **Configure the build environment**:
  42.    ```bash
  43.    ./configure --enable-optimizations
  44.    ```

  45. 4. **Build and install Python 3**:
  46.    ```bash
  47.    make -j 4  # Adjust the number based on your CPU cores
  48.    sudo make altinstall
  49.    ```

  50. 5. **Verify the installation**:
  51.    ```bash
  52.    python3.10 --version
  53.    ```

  54. ### Additional Steps (if needed)
  55. - **Create a symbolic link** (optional if you want to use `python3` as a command):
  56.   ```bash
  57.   sudo ln -s /usr/local/bin/python3.10 /usr/bin/python3
  58.   ```

  59. - **Install `pip` for Python 3**:
  60.   ```bash
  61.   sudo apt install python3-pip
  62.   ```

  63. These instructions should help you install Python 3 on your system. If you encounter any issues or need specific adjustments, feel free to ask!
复制代码
 楼主| 发表于 2024-5-24 23:54:24 | 显示全部楼层
交配交的人 发表于 2024-5-24 23:18
这神仙也是买来的吧

朋友 , 求助, 联系一下我呗
 楼主| 发表于 2024-5-25 00:34:41 | 显示全部楼层
继续求救, 论坛的朋友都很热情  
发表于 2024-5-25 00:36:23 | 显示全部楼层
装个宝塔面板 一键安装的  然后就可以随便安装版本了
 楼主| 发表于 2024-5-25 01:13:14 来自手机 | 显示全部楼层
重点是没有编译器
发表于 2024-5-25 01:22:31 | 显示全部楼层
我感觉可能是debian 改的
执行下这2个命令,看内容是什么
cat /etc/debian_version
cat /etc/issue
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-6-17 20:22 , Processed in 0.097000 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表