解决方案:
不使用系统默认 pip
$ conan
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2861, in _dep_map
return self.__dep_map
File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2695, in __getattr__
raise AttributeError(attr)
AttributeError: _DistInfoDistribution__dep_map
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/conan", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 3140, in <module>
@_call_aside
File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 3126, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 3153, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 640, in _build_master
ws.require(__requires__)
File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 941, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 836, in resolve
new_requirements = dist.requires(req.extras)[::-1]
File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2639, in requires
dm = self._dep_map
File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2863, in _dep_map
self.__dep_map = self._compute_dependencies()
File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2896, in _compute_dependencies
common = frozenset(reqs_for_extra(None))
File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2893, in reqs_for_extra
if req.marker_fn(override={'extra':extra}):
File "/usr/lib/python3.4/site-packages/_markerlib/markers.py", line 113, in marker_fn
return eval(compiled_marker, environment)
File "<environment marker>", line 1, in <module>
NameError: name 'implementation_name' is not defined
解决过程:
Github 有相关 Issue:Regression to 1.7.0 conan crash on startup on centos7/python 3.4
it seems it could be a bug with the pip3 from python3.4 of that distro, that raises with some of the conan dependencies that have been upgraded this release.
可使用如下方法代替:
- yum install -y epel-release
- yum install -y make gcc-c++ python34
- yum -y update nss
- curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
- python3.4 get-pip.py
- pip install conan