I tried to rebuild mongodb according to building.md(github repo) and I got the following error when executing the scons scrtip(sudo python3 buildscripts/scons.py install-mongod):
Generating build/opt/mongo/db/repl/rollback_gen.cpp
/usr/bin/python3 src/mongo/base/generate_error_codes.py src/mongo/base/error_codes.yml src/mongo/base/error_codes.tpl.h build/opt/mongo/base/error_codes.h
Traceback (most recent call last):
File "src/mongo/base/generate_error_codes.py", line 31, in <module>
from Cheetah.Template import Template
ModuleNotFoundError: No module named 'Cheetah'
Generating build/opt/mongo/db/repl/member_config_gen.cpp
Compiling build/opt/third_party/boost-1.70.0/libs/log/src/attribute_name.o
Compiling build/opt/third_party/icu4c-57.1/source/i18n/strrepl.o
Compiling build/opt/third_party/mozjs-60/extract/modules/fdlibm/s_rintf.o
Generating build/opt/mongo/db/ops/delete_request_gen.cpp
Compiling build/opt/third_party/mozjs-60/extract/modules/fdlibm/s_fabs.o
scons: *** [build/opt/mongo/base/error_codes.h] Error 1
scons: building terminated because of errors.
build/opt/mongo/base/error_codes.h failed: Error 1
Note:
I have Cheetah installed in /home/ubuntu/.local/lib/python3.8/site-packages/Cheetah and it is in PYTHONPATH. The potential problem might be that the subprocess has no idea of the original ENV variable but I don't know how to fix it. Specifically, I don't know which file invoked this subprocess.