Good to hear you figured out the (binary?) installation issue.
However, that doesn’t solve the build from source failure.
Could you clean the build (python setup.py clean), update all submodules (git submodule update --init --recursive) and rebuild it?
While the build is running, you could use htop to observe the system RAM.