我正在pip3
为我的 python 项目安装模块。我的requirements.txt
样子是这样的:
urllib3==1.22
cx_freeze==6.0b1
pytest==3.2.2
pytest-cov==2.5.1
pytest-dependency==0.2
我显然已经pytest
添加了我的要求,但是当我运行pip3 install -r requirements.txt
它时找不到pytest
并显示以下异常:
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-y300zryw/pytest-dependency/setup.py", line 9, in <module>
import pytest_dependency
File "/tmp/pip-build-y300zryw/pytest-dependency/pytest_dependency.py", line 8, in <module>
import pytest
ModuleNotFoundError: No module named 'pytest'
当我手动执行 apip3 install pytest
然后运行我的需求文件时,它工作正常。
为什么 pytest 不从安装requirements.txt
?