1 概述

Debian10安装MyCLI

环境:

  • Debian10
  • Python3.7

2 准备环境

2.1 Python

首先确保安装了Python

apt install python3

若是没有换源建议先换源,这里列出了阿里的源:

deb http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb http://mirrors.aliyun.com/debian-security buster/updates main
deb-src http://mirrors.aliyun.com/debian-security buster/updates main
deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib

使用:

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudo vim /etc/apt/sources.list

把源复制过去即可。

安装完成后可以加个软链:

sudo ln -s /usr/bin/python3 /usr/bin/python

2.2 pip

同时需要安装pip

apt install python3-pip

安装完成后,可以先添加一个别名:

sudo ln -s /usr/bin/pip3 /usr/bin/pip

再测试一下:

pip --version

接着为pip换源,先创建~/.pip目录,在创建~/.pip/pip.conf文件:

mkdir ~/.pip
cd ~/.pip
vim pip.conf

输入如下内容:

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = https://pypi.tuna.tsinghua.edu.cn

可以使用pip config list查看是否存在镜像:

3 安装MyCLI

pip install mycli

使用:

mycli -u USERNAME

输入密码即可:

03-05 15:50