Python pytest安装:TypeError:';模块';对象不可调用
我正在通过运行以下命令安装pytest:Python pytest安装:TypeError:';模块';对象不可调用,python,installation,pytest,Python,Installation,Pytest,我正在通过运行以下命令安装pytest: pip install pytest 在我的壳里。但我得到: Traceback (most recent call last): File "c:\program files\python37\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "c:\program files\python37\lib\runpy.py", line
pip install pytest
在我的壳里。但我得到:
Traceback (most recent call last):
File "c:\program files\python37\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\program files\python37\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Program Files\Python37\Scripts\pip3.exe\__main__.py", line 9, in <module>
TypeError: 'module' object is not callable
我没有发现任何错误
你能帮我吗
PS:我的最终目标是跑步
pytest --cov="file-name" --cov-report html test_*.py
作为命令您只需
导入pytest
,而不是使用pytest导入中的*
和pytest-v-s relativepath
将路径添加到文件中
或文件夹
如果使用Python3.x,请尝试检查您使用的python版本
python3安装pytest
有几件事:python3安装pytest
运行正常,但是当我键入pytest-v-s relativepath
或者甚至pytest--version
时,我会遇到另一个错误+CategoryInfo:ObjectNotFound:(pytest:String)[],CommandNotFoundException+FullyQualifiedErrorId:CommandNotFoundException
pytest --cov="file-name" --cov-report html test_*.py