找不到pytest的命令(-bash: pytest: command not found),但安装了库

时间:2024-03-25 16:14:01

1. 这几天想试试pytest框架,在官网查了步骤https://docs.pytest.org/en/latest/contents.html,和安装方法

pip install -U pytest ---> 我电脑的实操 pip3 install -U pytest

找不到pytest的命令(-bash: pytest: command not found),但安装了库2. 但是验证pytest是否安装成功时,提示:-bash: pytest: command not found

3. 中间操作了默认python版本的切换,然后查找pytest库的安装:pip3 list

找不到pytest的命令(-bash: pytest: command not found),但安装了库

4. 找到一个帖子 https://xbuba.com/questions/35998992,与我的标题相符“找不到Py.test命令,但安装了库”,给了一个方案使用python -m pytest

5. 新的问题出现了

找不到pytest的命令(-bash: pytest: command not found),但安装了库

问题并没有解决....