赞
踩
pi@raspberrypi:~ $ sudo apt-get update
pi@raspberrypi:~ $ sudo apt-get upgrade
pi@raspberrypi:~ $ sudo apt-get install build-essential libsqlite3-dev sqlite3 bzip2 libbz2-dev
你也可以 下载其他的python版本
pi@raspberrypi:~ $ wget https://www.python.org/ftp/python/3.8.5/Python-3.8.5.tgz
pi@raspberrypi:~ $ tar zxvf Python-3.8.5.tgz
pi@raspberrypi:~ $ cd Python-3.8.5/
pi@raspberrypi:~/Python-3.8.5 $ sudo ./configure
pi@raspberrypi:~/Python-3.8.5 $ sudo make
pi@raspberrypi:~/Python-3.8.5 $ sudo make install
# 安装了python3.8.5
pi@raspberrypi:~ $ python3
Python 3.8.5 (default, Sep 14 2020, 11:24:11)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
# 之前卸载了python2.7
pi@raspberrypi:~ $ python
bash: python: 未找到命令
vi .bashrc
# 修改别名
alias python='python3'
# 保存退出,用source让配置生效
source .bashrc
现在可以用python命令咯,打开默认是python3.8.5
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。