简体   繁体   English

SConscript EnvironmentError:没有名为compile_db的模块

[英]SConscript EnvironmentError: No module named compilation_db

I'm trying to compile the GitHub project: https://github.com/commaai/openpilot , I'm getting an error when creating the SCons environment (the call to Environment()), it points this line:我正在尝试编译 GitHub 项目: https://github.com/commaai/openpilot ,在创建 SCons 环境(对 Environment() 的调用)时出现错误,它指向这一行:

Environement(
# Other options ...
tools=["default", "cython", "compilation_db"
)

The result of the scons is then: scons 的结果是:

scons: Reading SConscript files ...
EnvironmentError: No module named compilation_db:
  File "/home/skoumad/openpilot/master/SConstruct", line 213:
    "compilation_db"
  File "/usr/lib/scons/SCons/Environment.py", line 982:
    apply_tools(self, tools, toolpath)
  File "/usr/lib/scons/SCons/Environment.py", line 107:
    env.Tool(tool)
  File "/usr/lib/scons/SCons/Environment.py", line 1788:
    tool = SCons.Tool.Tool(tool, toolpath, **kw)
  File "/usr/lib/scons/SCons/Tool/__init__.py", line 118:
    module = self._tool_module()
  File "/usr/lib/scons/SCons/Tool/__init__.py", line 215:
    raise SCons.Errors.EnvironmentError(error_string)

I tried to install compilation_db using: https://pypi.org/project/scons-compiledb/0.4.7/ but still the same error:/.我尝试使用: https://pypi.org/project/scons-compiledb/0.4.7/安装compile_db,但仍然出现相同的错误:/。

Any idea on how to install this missing module??关于如何安装这个缺少的模块的任何想法?

Regards.问候。

You likely have a version of SCons older than 4.0.0您的 SCons 版本可能早于 4.0.0

The compilation_db tool was added in 4.0.0在 4.0.0 中添加了compilation_db工具

See release notice发布通知

If you're distro(linux,python, macports, etc) doesn't have 4.0.0 or newer, then I'd advise setting up a python virtualenv (no this is not a VM, it's just a tool to create a clean python environment to install packages in)如果您的发行版(linux、python、macports 等)没有 4.0.0 或更高版本,那么我建议您设置一个 python virtualenv (不,这不是 VM,它只是一个创建干净的工具python 环境安装包)

Here's how to do that:以下是如何做到这一点:

# assuming posix system, for win32, of course change the path to windows correct syntax
# also the python below should be 3.5 or newer, generally it's best to use the newest installed
python -m venv ~/sconsvenv 
. ~/sconsvenv/bin/activate
pip install  scons

scons --version

# should yield

SCons by Steven Knight et al.:
    SCons: v4.1.0.post1.dc58c175da659d6c0bb3e049ba56fb42e77546cd, 2021-01-20 04:32:28, by bdbaddog on ProDog2020
    SCons path: ['/Users/bdbaddog/sconsvenv/lib/python3.8/site-packages/SCons']
Copyright (c) 2001 - 2021 The SCons Foundation

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM