Can not do repo init for Android Pie


I am not able to do repo init. I am getting the following error.


remote: Counting objects: 1, done
remote: Finding sources: 100% (30/30)
remote: Total 30 (delta 2), reused 30 (delta 2)
Unpacking objects: 100% (30/30), done.
7f7acfe…5e2f32f main -> origin/main
4b32581…352c93b stable -> origin/stable

  • [new tag] v2.10 -> v2.10
    Traceback (most recent call last):
    File “/media/parth/BSP_Storage/vim3_sdk/.repo/repo/”, line 56, in
    from subcmds.version import Version
    File “/media/parth/BSP_Storage/vim3_sdk/.repo/repo/subcmds/”, line 38, in
    [’%s’ % name])
    File “/media/parth/BSP_Storage/vim3_sdk/.repo/repo/subcmds/”, line 27, in
    from hooks import RepoHook
    File “/media/parth/BSP_Storage/vim3_sdk/.repo/repo/”, line 472
    SyntaxError: invalid syntax

This is urget. Can anybody tell me the solution?

This appears to be a question not regarding the VIM3 but more Linux in general.
Suggest you try at or similar for the O/S your working with.

1 Like

@JustSumDad its android building question to be precise, but yes, the approach is true

@Parth you better check on some Android forums, or the android discord server, if you really want faster response to your questions based on android building, or check on stackoverflow,
those are the best places you can find answers quick :slightly_smiling_face:

1 Like

I am not trying to build the source code but just trying to init the repo of Android Pie for VIM3. I am trying to download the SDK for VIM3.

Command ----> repo init -u -b khadas-vims-pie

@JustSumDad @Electr1
Solved this problem by downloading the latest version of Repo.


Hi Parth, how do you get the last version?
I updated today but the error is still there.

Thanks, Juan.

did you configure your environment before building ?

Python-related error

1 Like

Hi Boudour,
I try this but nothing different happened.

I think, like taimed said, is related with Python, this is the log

Any suggest?
Thank you for your help.
Regards, Juan.

try to configure your environment

$ sudo apt-get install repo
$mkdir ~/bin
$curl > ~/bin/repo
$chmod a+x ~/bin/repo

$ sudo apt-get install git gnupg flex bison build-essential zip curl zlib1g-dev gcc-multilib g+±multilib libc6-dev-i386 lib32ncurses-dev x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev libxml2-utils xsltproc unzip fontconfig ccache u-boot-tools
see this

after that check if you are using python 3 if no so install it there is a problem with python


delete the /home/bin folder a,nd reinstall the repo again

python3 + instruction
python3 repo init …


Yes, you are trying to run python 3 files in python 2 environments.

I followed three steps to solve this issue. Let me give you the steps.

  1. Download the last version of repo: curl > repo

  2. Change right to make it executable: chmod a+x repo

After these two steps add ‘repo’ in the local path.

  1. Run your repo init with python3 and the “repo” you just download: python3 repo init -u -b khadas-vims-pie

Let me know if this works for you or not.


I follow the steps and it works like charm!
Thank you Boudour, taimed and Parth!

Regards, Juan.


I spent 3 hours on this topic and finally found these command works for me.

My python3 is Python 3.6.9 and python is Python 2.7.17 running on Ubuntu 18.04.

sudo apt-get install git-core gnupg flex bison build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev libxml2-utils xsltproc unzip fontconfig

sudo apt-get install ca-certificates
sudo update-ca-certificates --fresh
sudo apt install python2
sudo update-alternatives --install /bin/python python /usr/bin/python3.8 1
sudo update-alternatives --install /bin/python python /usr/bin/python2.7 2
sudo update-alternatives --config python //choose 2
mkdir ~/bin
curl -k > ~/bin/repo
chmod a+x repo 
git config --global "xxx"
git config --global user.mail""
mkdir ./workspace
cd workspace
which repo
sudo mkdir /opt/toolchains
sudo tar -xjf gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.bz2 -C /opt/toolchains
sudo tar -xjf gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2 -C /opt/toolchains
sudo tar xvJf gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabihf.tar.xz -C /opt/toolchains
sudo tar xvJf gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu.tar.xz -C /opt/toolchains
cd workspace/
ls -al
mkdir vim3
cd vim3
tar xvzf git-lfs-linux-amd64-2.3.4.tar.gz
cd git-lfs-2.3.4
git init
git config http.sslVerify false
sudo ./
cd ..
mkdir bsp
cd bsp
repo init -u -b khadas-vims-pie
repo sync -j4
cd bsp/
cd bootloader/uboot/
./mk kvim3 
cd ..
cd ..
cp bootloader/uboot/build/tools/mkimage ~/bin/mkimage
chmod +x ~/bin/mkimage
cd ..
source build/ 
lunch kvim3-userdebug
make -j2 otapackage

[Reference cmd]
sudo apt-get install openjdk-8-jdk android-tools-adb bc bison build-essential curl flex g+±multilib gcc-multilib gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev lib32z1-dev liblz4-tool libncurses5-dev libsdl1.2-dev libssl-dev libwxgtk3.0-gtk3-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc yasm zip zlib1g-dev git-core python3.8 libncurses5

Hope my sharing could help you :slight_smile:
My VM used to build vim3 only takes 259 GB.


I follow the steps and it works! (only revise two instructions below)
Thank you ChiaHungMou :slight_smile:

sudo update-alternatives --install /bin/python python /usr/bin/python3.6 1
sudo update-alternatives --install /bin/python python /usr/bin/python2.7 2

1 Like

Yes, it works. This is a python issue.

1 Like

Thanks a lot, above set of commands related to Python worked for me.