我的本地主机系统是Window11,自行安装ubuntu20.04系统,通过Linux环境搭建一个HttpRunner。
ubuntu20.04环境:
rosaany@Rosefinch:~$ sudo apt install python3-pip
执行完发现报错:E: Package 'python3-pip' has no installation candidate
,想到本地源需要替换一下
rosaany@Rosefinch:~$ sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
以阿里源为例
rosaany@Rosefinch:~$ sudo vim /etc/apt/sources.list # 替换为如下的源 deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse # 替换保存退出后 更新 源 sudo apt update
rosaany@Rosefinch:~$ sudo apt install python3-pip
rosaany@Rosefinch:~$ pip3 install httprunner
安装 HttpRunner 后,系统中将添加 5 个命令:
rosaany@Rosefinch:~$ httprunner httprunner: command not found
出现上面报错是因为相关指令没找到,默认会到/usr/bin目录下寻找命令
利用find
命令查找httprunner目录所在
rosaany@Rosefinch:~$ httprunner -V 3.1.6
同理的,其它命令如果也报类似的错误,通过find和ln
命令建立一个软链接