我已经在系统上安装了pytest。当我使用pytest运行命令时。我遇到以下错误。
Traceback (most recent call last):
File "/usr/local/bin/pytest", line 5, in <module>
from pkg_resources import load_entry_point
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3095, in <module>
@_call_aside
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3081, in _call_aside
f(*args, **kwargs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3108, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 658, in _build_master
ws.require(__requires__)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 959, in require
needed = self.resolve(parse_requirements(requirements))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 846, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pathlib2>=2.2.0' distribution was not found and is required by pytest
此外,我在CLI上输入了“ pip install pathlib2”
Requirement already satisfied: pathlib2 in /usr/local/lib/python2.7/site-packages (2.2.0)
Requirement already satisfied: scandir in /usr/local/lib/python2.7/site-packages (from pathlib2) (1.9.0)
Requirement already satisfied: six in /usr/local/lib/python2.7/site-packages (from pathlib2) (1.11.0)
但是它不起作用,同样的错误。