如何在raspberry pi上更新到最新的Python3.5.1版本?

2024-04-18 14:23:35 发布

您现在位置:Python中文网/ 问答频道 /正文


Tags: python
2条回答

我会自己编译它(事实上,有几次)。我假设你在运行Ubuntu或Raspbian。你应该能够install the dependencies

$ sudo apt-get install build-essential \
                       libncursesw5-dev \
                       libreadline5-dev \
                       libssl-dev \
                       libgdbm-dev \
                       libc6-dev \
                       libsqlite3-dev tk-dev \
                       libbz2-dev

然后去download the source提取它,然后安装它:

  $ tar -xzvf https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tgz
  $ cd Python-3.5.1
  $ ./configure && make && sudo make install

如果缺少依赖项,它可能会在./configure步骤中死亡。但如果一切正常,您将在Raspberry Pi上安装一个全新的Python 3.5。恭喜!

cd ~
wget https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tgz
tar -zxvf Python-3.5.1.tgz
cd Python-3.5.1
./configure && make && sudo make install

相关问题 更多 >