How to execute scons in a python3 environment?

Chouettou picture Chouettou · Jan 10, 2018 · Viewed 9.7k times · Source

I need to import python3 scripts within a scons script. (I use scons v3.0.1.7)

Is there a way to execute scons with python 3 ?

The offical scons site says

This will be the first release to support Python versions earlier than 2.7 as well as 3.5+

Something like scons -python /usr/bin/python3 would be good to select the python interpreter.

I did not find either how to build a scons version for python3.

Answer

Chouettou picture Chouettou · Jan 11, 2018

Here is a better solution, add this to your .bash_profile:

alias scons3="/usr/bin/env python3 $(which scons)"