解决centos pip 安装报Requirement already satisfied但执行却找不到命令
centos 7 服务器使用pip安装pytest,回显内容:
Requirement already satisfied: ...
这是说 pytest 已经安装了。但为什么命令行输入 pytest 还是找不到命令呢?原因是没有配置环境变量。
小编使用的是 yum 安装的 python3,pytest路径:
pytest: /usr/local/python3/bin/pytest
在文件 .bashrc
配置环境变量:
PY='/usr/local/python3/bin'
export PATH=$PATH:$PY
source ~/.bashrc
这样就可以了。