由於 mycli 依賴於 cryptography,而后者需要 openssl 1.1.0 或 1.1.1 (參見 https://cryptography.io/en/latest/installation.html),而 CentOS7 默認使用 yum 安裝的 openssl 是 1.0.x,所以不能成功安裝 cryptography,進而不能成功安裝 mycli。解決如下,
從 https://www.openssl.org/source/old/1.1.0/ 下載 openssl-1.1.0l.tar.gz,解壓縮直接安裝,(注意,這里把 openssl 安裝到默認路徑,即頭文件在 /usr/local/include,庫文件在 /usr/local/lib。如果不在標准路徑,安裝 cryptography 時可能找不到頭文件)
$ ./config $ make $ sudo make install
再安裝 cryptography,
$ sudo pip3 install -i https://pypi.douban.com/simple cryptography
再安裝 mycli,
$ sudo pip3 install -i https://pypi.douban.com/simple/ mycli
(完)