Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Force make to use python2?

I’m trying to build an Android kernel with make command. The script uses python2 to log errors in the print >> sys.stderr, line fashion. So instead of actual error output I get errors about incorrect python syntax.

I had an idea to delete python3, but I read that it could be harmful to the system as it comes bundled and many things might depend on it. Tried adding alias python=python2 at the end of the .bashrc file, rebooted the terminal, tested it with the line:

echo `python -c "print 'test'"`  # prints 'test' correctly

But when I make, I still get the same errors, it somehow manages to use python3 anyways.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Where is my mistake?

>Solution :

You did not show your Makefile. The easiest thing is to define the absolute path of python on your system. You can get that by using the which command. Then, change python in Makefile to the absolute path that you found out using which python2.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading