我正在遵循Vagrant(Ubuntu 18.04 / Python3.6.6)中的python-django教程。运行pip3 install pytest-django
并配置pytest.ini
文件后,运行pytest
返回
Command 'pytest' not found, but can be installed with:
apt install python-pytest
Please ask your administrator.
pip3 freeze
输出:
pytest==3.10.0
pytest-django==3.4.3
安装还有其他内容吗?
答案 0 :(得分:1)
尝试使用python -m pytest
通过pip安装pytest不会使其成为系统命令,而是会将其安装到python。 -m命令将pytest作为其自己的命令运行,然后任何继续执行的脚本都将作为参数。