I run the following commands to get repo
:
mkdir ~/bin
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
PATH=${PATH}:~/bin
I have 2 python versions(2.7 and 3.7) in my computer so I created an alias to python3 in ~/.bashrc
because this is required by repo
alias python=python3
Then run following commands to get the yocto project:
repo init -u https://xxxx -b release/bxxx
I got this error:
File "/Path/.repo/repo/main.py", line 79
file=sys.stderr)
^
SyntaxError: invalid syntax
if I run python3 ~/bin/repo init -u https:/blablabla
there is no problem, so some how executing the first command calls to python2
. Any explanation
Two points to the explanation you're looking for:
#!/usr/bin/env python
which might be pointing to python 2.7 on your machine. Try just writing /usr/bin/env python
on your terminal and seeing which version of python console is launched. See this answer for suggestions.from __future__ import print_function
doesn't seem to be working as expected (which would make that syntax okay). Not sure why that's happening though.