# Cant get legato source

**URL:** <https://forum.legato.io/t/cant-get-legato-source/6350>\
**Category:** Legato Application Framework\
**Created:** [November 25, 2022, 8:49am UTC](https://forum.legato.io/t/cant-get-legato-source/6350 "2022-11-25T08:49:11Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![suneel.mekala](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@suneel.mekala](https://forum.legato.io/u/suneel.mekala)\
**Post date:** [November 25, 2022, 8:49am UTC](https://forum.legato.io/t/cant-get-legato-source/6350/1 "2022-11-25T08:49:11Z")

</div>

$ **leaf getsrc legato**  
_Run sync steps for fx30-cat1-legato-src\_19.11.5_

_Ready to sync in /home/suneel/myWorkspace/legato-src directory:_  
_repo init -u ssh://git@github.com/legatoproject/manifest -m legato/releases/19.11.5/legato.xml -g default,proprietary ; repo sync_

_Proceed? (Y/n)_  
_Y_  
_Checking credentials…_

- File “/home/suneel/myWorkspace/legato-src/.repo/repo/main.py”, line 79\*
- file=sys.stderr)\*

_SyntaxError: invalid syntax_  
_ERROR:_

- Something went wrong with `repo` command\*  
_HINTS:_
- Please check connection and credentials\*
- Then try again leaf getsrc legato\*

**I found that the python2.7 is the problem when I changed to python3 I got the following error :**  
$ leaf getsrc legato  
_Run sync steps for fx30-cat1-legato-src\_19.11.5_

_Ready to sync in /home/suneel/myWorkspace/legato-src directory:_  
_repo init -u ssh://git@github.com/legatoproject/manifest -m legato/releases/19.11.5/legato.xml -g default,proprietary ; repo sync_

_Proceed? (Y/n)_  
_Y_  
_Checking credentials…_  
_warning: Python 3 support is currently experimental. YMMV._  
_Please use Python 2.6 - 2.7 instead._  
_Traceback (most recent call last):_

- File “/home/suneel/myWorkspace/legato-src/.repo/repo/main.py”, line 38, in \*
- from color import SetDefaultColoring\*
- File “/home/suneel/myWorkspace/legato-src/.repo/repo/color.py”, line 18, in \*
- import pager\*
- File “/home/suneel/myWorkspace/legato-src/.repo/repo/pager.py”, line 63\*
- sys.exit(f’fatal: cannot start pager “{pager}”')\*

_SyntaxError: invalid syntax_  
_ERROR:_

- Something went wrong with `repo` command\*  
_HINTS:_
- Please check connection and credentials\*
- Then try again leaf getsrc legato\*

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [November 25, 2022, 9:44am UTC](https://forum.legato.io/t/cant-get-legato-source/6350/2 "2022-11-25T09:44:15Z")

</div>

you can see here on how to use repo with python3:

> <https://stackoverflow.com/questions/65193998/syntaxerror-invalid-syntax-to-repo-init-in-the-aosp-code>

You can see here for an example on downloading WP76 yocto source from Github: (it also uses repo with python3)

> **[Git Repository](https://forum.sierrawireless.com/t/git-repository/24389/10)**
>
> I follow this document and I don’t see problem to download from github: Example on downloading WP76 yocto source from Github.docx (90.5 KB) owner@CNHKG-EX-001367:~/Yocto/WP76/R16\_test$ git config --global user.name "username"...

---

<div class="post-metadata">

**Author:** ![suneel.mekala](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@suneel.mekala](https://forum.legato.io/u/suneel.mekala)\
**Post date:** [November 25, 2022, 12:30pm UTC](https://forum.legato.io/t/cant-get-legato-source/6350/3 "2022-11-25T12:30:33Z")

</div>

The solution is to use python3 with repo. Which means I will have to change a lot of scripts in legeto framework which I dont want to do as it demands maintenance.

What is the official statement on this issue ? I see with leaf it should just work. Is this a known issue and is someone working on it ?

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [November 25, 2022, 1:01pm UTC](https://forum.legato.io/t/cant-get-legato-source/6350/4 "2022-11-25T13:01:08Z")

</div>

Repo is for downloading code, not in legato framework

Btw, a lot of user can download

> **[Search results for 'Getsrc fx30' - Sierra Wireless Forum](https://forum.sierrawireless.com/search?q=Getsrc%20fx30)**
>
> Sierra Wireless Developer Community Forum

You can also try in Ubuntu16 or Ubuntu18 in VMwware

> [@Legato vscode install Ubuntu 22.04.1](https://forum.legato.io/t/legato-vscode-install-ubuntu-22-04-1/6301/3):
>
> So the only way to fix it is using an old Ubuntu version?

---

<div class="post-metadata">

**Author:** ![suneel.mekala](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@suneel.mekala](https://forum.legato.io/u/suneel.mekala)\
**Post date:** [November 28, 2022, 11:11am UTC](https://forum.legato.io/t/cant-get-legato-source/6350/5 "2022-11-28T11:11:29Z")

</div>

By Legato framework I mean the legato development environment which is basically leaf. Leaf internally uses repo. It creates a dir .repo in legaro-src dir when you enter leaf getsrc legato and the solution above is to change this .repo to point to python3. This is a hack which I want to avoid . As there is no where in the documentation it is mentioned that python3 is needed. Infact leaf has dependencies on python2 not python3.

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [November 28, 2022, 11:32am UTC](https://forum.legato.io/t/cant-get-legato-source/6350/6 "2022-11-28T11:32:03Z")

</div>

Don’t know why you cannot use python2 then…  
You can also try in Ubuntu16 or Ubuntu18 in VMwware

---

<div class="post-metadata">

**Author:** ![suneel.mekala](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@suneel.mekala](https://forum.legato.io/u/suneel.mekala)\
**Post date:** [November 28, 2022, 11:35am UTC](https://forum.legato.io/t/cant-get-legato-source/6350/7 "2022-11-28T11:35:12Z")

</div>

Anyways I tried the above solution as well. But I am getting other errors:

Run sync steps for fx30-cat1-legato-src\_19.11.5

Ready to sync in /home/suneel/myWorkspace/legato-src directory:  
repo init -u ssh://git@github.com/legatoproject/manifest -m legato/releases/19.11.5/legato.xml -g default,proprietary ; repo sync

Proceed? (Y/n)  
Y  
Checking credentials…  
Traceback (most recent call last):  
File “/home/suneel/myWorkspace/legato-src/.repo/repo/main.py”, line 38, in   
from color import SetDefaultColoring  
File “/home/suneel/myWorkspace/legato-src/.repo/repo/color.py”, line 18, in   
import pager  
File “/home/suneel/myWorkspace/legato-src/.repo/repo/pager.py”, line 63  
sys.exit(f’fatal: cannot start pager “{pager}”')  
^  
SyntaxError: invalid syntax  
ERROR:  
Something went wrong with `repo` command  
HINTS:  
Please check connection and credentials  
Then try again leaf getsrc legato

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [November 28, 2022, 12:07pm UTC](https://forum.legato.io/t/cant-get-legato-source/6350/8 "2022-11-28T12:07:11Z")

</div>

Did you install pager?  
pip install pager

---

<div class="post-metadata">

**Author:** ![suneel.mekala](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@suneel.mekala](https://forum.legato.io/u/suneel.mekala)\
**Post date:** [November 29, 2022, 9:45am UTC](https://forum.legato.io/t/cant-get-legato-source/6350/9 "2022-11-29T09:45:25Z")

</div>

It is installed. The problem is why it is reporting syntax error ?

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [November 29, 2022, 9:57am UTC](https://forum.legato.io/t/cant-get-legato-source/6350/10 "2022-11-29T09:57:11Z")

</div>

no idea, i don’t have much experience in python…  
did you see problem on Ubuntu 16 or Ubuntu 18?

---

<div class="post-metadata">

**Author:** ![suneel.mekala](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@suneel.mekala](https://forum.legato.io/u/suneel.mekala)\
**Post date:** [November 29, 2022, 10:13am UTC](https://forum.legato.io/t/cant-get-legato-source/6350/11 "2022-11-29T10:13:57Z")

</div>

16  
Distributor ID: Ubuntu  
Description: Ubuntu 16.04.7 LTS  
Release: 16.04  
Codename: xenial

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [November 29, 2022, 10:55am UTC](https://forum.legato.io/t/cant-get-legato-source/6350/12 "2022-11-29T10:55:36Z")

</div>

Here is my environment in ubuntu 16 with VSCode to download leaf package :

```auto
owner@CNHKG-EX-001367:~/QMI/MBPL/R23/USB$ leaf --version
leaf version 2.1
owner@CNHKG-EX-001367:~/QMI/MBPL/R23/USB$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.7 LTS
Release:	16.04
Codename:	xenial
owner@CNHKG-EX-001367:~/QMI/MBPL/R23/USB$ python --version
Python 2.7.9
owner@CNHKG-EX-001367:~/QMI/MBPL/R23/USB$ python3 --version
Python 3.5.3

```

 ![image](https://us1.discourse-cdn.com/flex019/uploads/legato1/original/2X/1/1f0b4ae30f7301631759ffff36a8b1ed363d9d9c.png)

Other user also makes it work on Ubuntu18 VM machine:

> [@Legato vscode install Ubuntu 22.04.1](https://forum.legato.io/t/legato-vscode-install-ubuntu-22-04-1/6301/6):
>
> Okay so we tested a virtual machine with Ubuntu 18 it works fine
