repo issue "def print(self, *args, **kwargs):"

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

repo issue "def print(self, *args, **kwargs):"

repo issue "def print(self, *args, **kwargs):"

Symptoms

 

Trying to initialize a repo, for example: 

$repo init -u https://github.com/nxp-imx/imx-manifest -b imx-linux-mickledore -m imx-6.1.36-2.1.0.xml

we have the below log:

File "/home/username/bin/repo", line 51
def print(self, *args, **kwargs):
^
SyntaxError: invalid syntax

 

Workaround (1)

 

The first workaround consist in change the python alternatives (caused when you have installed two or more python versions).

NOTE: in my case, the python version that i want to change as first priority is python3.8

$sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1

 

Then we run:

$sudo update-alternatives --config python

 

 To verify if your python priority was changed successfully try:

$python --version

 

You should see the version configured as priority number 1.

 

 

Workaround (2)

 

The workaround is very simple, only we need modify the repo file

$ nano ~/bin/repo

 

and we will change the python interpreter in the first line (from python to python3):

ORIGINAL FILE

Alejandro_Salas_0-1699913847562.png

 

EDITED FILE

Alejandro_Salas_1-1699913905532.png

 

After to do this change, repo will works fine again.

 

 

I hope this can helps to you!

 

Best regards.

%3CLINGO-SUB%20id%3D%22lingo-sub-1756521%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3Erepo%20issue%20%22def%20print(self%2C%20*args%2C%20**kwargs)%3A%22%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1756521%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CDIV%20class%3D%22lia-message-template-symptoms-zone%22%3E%0A%3CH2%20id%3D%22toc-hId--1239890259%22%20id%3D%22toc-hId--500120016%22%3ESymptoms%3C%2FH2%3E%0A%3CBR%20%2F%3E%0A%3CP%3ETrying%20to%20initialize%20a%20repo%2C%20for%20example%3A%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%24repo%20init%20-u%20https%3A%2F%2Fgithub.com%2Fnxp-imx%2Fimx-manifest%20-b%20imx-linux-mickledore%20-m%20imx-6.1.36-2.1.0.xml%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3Ewe%20have%20the%20below%20log%3A%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3EFile%20%22%2Fhome%2Fusername%2Fbin%2Frepo%22%2C%20line%2051%0Adef%20print(self%2C%20*args%2C%20**kwargs)%3A%0A%5E%0ASyntaxError%3A%20invalid%20syntax%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CBR%20%2F%3E%0A%3CH2%20id%3D%22toc-hId-1247622574%22%20id%3D%22toc-hId-1987392817%22%3EWorkaround%20(1)%3C%2FH2%3E%0A%3CBR%20%2F%3E%0A%3CP%3EThe%20first%20workaround%20consist%20in%20change%20the%20python%20alternatives%20(caused%20when%20you%20have%20installed%20two%20or%20more%20python%20versions).%3C%2FP%3E%0A%3CP%3ENOTE%3A%20in%20my%20case%2C%20the%20python%20version%20that%20i%20want%20to%20change%20as%20first%20priority%20is%20python3.8%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%24sudo%20update-alternatives%20--install%20%2Fusr%2Fbin%2Fpython%20python%20%2Fusr%2Fbin%2Fpython3.8%201%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CBR%20%2F%3E%0A%3CP%3EThen%20we%20run%3A%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%24sudo%20update-alternatives%20--config%20python%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%26nbsp%3BTo%20verify%20if%20your%20python%20priority%20was%20changed%20successfully%20try%3A%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%24python%20--version%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%0A%3CDIV%20class%3D%22lia-message-template-solution-zone%22%3E%0A%3CH2%20id%3D%22toc-hId--559831889%22%20id%3D%22toc-hId-179938354%22%3E%26nbsp%3B%3C%2FH2%3E%0A%3CP%3EYou%20should%20see%20the%20version%20configured%20as%20priority%20number%201.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CH2%20id%3D%22toc-hId-1927680944%22%20id%3D%22toc-hId--1627516109%22%3E%26nbsp%3B%3C%2FH2%3E%0A%3CH2%20id%3D%22toc-hId-120226481%22%20id%3D%22toc-hId-859996724%22%3EWorkaround%20(2)%3C%2FH2%3E%0A%3CBR%20%2F%3E%0A%3CP%3EThe%20workaround%20is%20very%20simple%2C%20only%20we%20need%20modify%20the%20repo%20file%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%24%20nano%20~%2Fbin%2Frepo%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CBR%20%2F%3E%0A%3CP%3Eand%20we%20will%20change%20the%20python%20interpreter%20in%20the%20first%20line%20(from%20python%20to%20python3)%3A%3C%2FP%3E%0A%3CP%3EORIGINAL%20FILE%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Alejandro_Salas_0-1699913847562.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Alejandro_Salas_0-1699913847562.png%22%20style%3D%22width%3A%20324px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F249632iECBC5DF25A50D2D3%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Alejandro_Salas_0-1699913847562.png%22%20alt%3D%22Alejandro_Salas_0-1699913847562.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CP%3EEDITED%20FILE%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Alejandro_Salas_1-1699913905532.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Alejandro_Salas_1-1699913905532.png%22%20style%3D%22width%3A%20251px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F249633i20ABA068FFC7B57D%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Alejandro_Salas_1-1699913905532.png%22%20alt%3D%22Alejandro_Salas_1-1699913905532.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CP%3EAfter%20to%20do%20this%20change%2C%20repo%20will%20works%20fine%20again.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CBR%20%2F%3E%0A%3CP%3EI%20hope%20this%20can%20helps%20to%20you!%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EBest%20regards.%3C%2FP%3E%0A%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1756521%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3Ei.MX%208%20Family%20%7C%20i.MX%208QuadMax%20(8QM)%20%7C%208QuadPlus%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Ei.MX%208M%20%7C%20i.MX%208M%20Mini%20%7C%20i.MX%208M%20Nano%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Ei.MX6%20All%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Ei.MX6DL%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Ei.MX6Dual%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Ei.MX6DualPlus%20%7C%206QuadPlus%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Ei.MX6Quad%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Ei.MX6S%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Ei.MX6SL%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Ei.MX6SoloX%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Ei.MX6UL%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Ei.MX7Dual%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Ei.MX7Solo%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Ei.MX7ULP%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
100% helpful (5/5)
Version history
Last update:
‎02-01-2024 09:50 AM
Updated by: