树莓派3B折腾纪录②


安装好系统之后的一点折腾

更改ssh密码

登录上之后有个警告,告诉我们需要更改默认密码

1
2
SSH is enabled and the default password for the 'pi' user has not been changed.
This is a security risk - please login as the 'pi' user and type 'passwd' to set a new password.

我们输入

1
passswd

根据提示输入当前密码,新密码就好了

在哪个用户下输入passwd就更改哪个用户的密码,sudo passwd更改的是root的密码

安装python3

RASPBIAN lite版系统自带只有python2,没有python3

1
2
python3
-shell: python3: command not found

我们下载py3的包

1
wget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xz

我们使用wget命令来下载,下载路径是当前路径,py3的版本可以自己选择

由于大家都知道的原因,速度会极慢。。。等等就好

输入命令解压

1
tar -xvf Python-3.6.2.tar.xz

tar是liunx是压缩命令,-x是解压缩或打包的功能, -v显示正在处理的文件名,-f后面接要被处理的文件名

然后cd进解压出来的文件夹里,README.rst是教程,(先偷偷安装一个vim)

教程提示我们

On Unix, Linux, BSD, macOS, and Cygwin::                      

./configure                                               
make                                                      
make test                                                 
sudo make install 

但是!!但是!!先不要编译!!!

因为这样直接编译,pip安装第三方库的时候会出现ssl错误,所以我们要先改动一些配置文件

先输入命令 sudo apt-get install libssl-dev安装

然后我们进入刚刚解压出来的python文件夹,使用vim Modules/Setup打开文件,把这几句的注释去掉(文件默认前面是带有#号的)

1
2
3
4
5
_socket socketmodule.c timemodule.c

_ssl _ssl.c \
-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-L$(SSL)/lib -lssl -lcrypto

然后我们才开始编译(又是一段可怕的时光,所以我想用docker。。。。)

文章目录
  1. 1. 安装好系统之后的一点折腾
    1. 1.1. 更改ssh密码
    2. 1.2. 安装python3
|