问题解决:Conan 使用 Python3.4 报 NameError: name 'implementation_name' is not defined

解决方案:

不使用系统默认 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
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值