找不到Py.test命令,但已安装库

编程入门 行业动态 更新时间:2024-10-28 04:17:31
本文介绍了找不到Py.test命令,但已安装库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

关于该主题的堆栈溢出已有两篇文章;但是,他们都没有解决或解决我的具体情况.

There are already two posts on stack overflow on this topic; however, none of them have resolved or addressed my specific situation.

我已经通过pip install pytest安装了pytest.我也可以用Python导入该库.

I have installed pytest via pip install pytest. I am able to import the library in Python as well.

问题在于,当我尝试在Terminal中使用py.test命令时,我得到了py.test: command not found.

The problem is that when I try to use the py.test command in Terminal, I get py.test: command not found.

有人对我为什么不能在终端中使用该命令有任何见解吗?

Does anyone have any insight as to why I am not able to use the command in the terminal?

它甚至显示为已安装的软件包:

It even shows up as an installed package:

$ pip list cycler (0.9.0) matplotlib (1.5.1) numpy (1.10.1) pip (8.1.0) py (1.4.31) pyparsing (2.0.7) pytest (2.9.0) python-dateutil (2.4.2) pytz (2015.7) scipy (0.17.0) setuptools (7.0) six (1.10.0) tensorflow (0.5.0) vboxapi (1.0) wheel (0.26.0)

推荐答案

使用python -m pytest将对您有效.

或者,如果您使用虚拟环境并在virtualenv上安装了pytest,则应在虚拟环境旁边运行py.test.

Or if you using virtual environment and installed pytest on virtualenv you should then run py.test alongside your virtual environment.

检查此网站可能有用: pythontesting/framework/pytest/pytest-introduction/

Check this website can be useful:pythontesting/framework/pytest/pytest-introduction/

更多推荐

找不到Py.test命令,但已安装库

本文发布于:2023-10-28 00:33:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1534982.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:找不到   但已   命令   test   Py

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!