Select Page

(Hint: Don’t)


Today my checkpatch.pl complained all of a sudden:

peilin@PWN:~/Desktop/linux_next$ scripts/checkpatch.pl —strict —codespell -f $FILE
Traceback (most recent call last):
File “scripts/spdxcheck.py”, line 6, in <module>
from ply import lex, yacc
ImportError: No module named ply
peilin@PWN:~/Desktop/linux_next$ echo :/
:/

Um, what? It seems that spdxcheck.py invoked my Python 2.


…I don’t even have pip for Python 2!

peilin@PWN:~/Desktop$ wget -q https://bootstrap.pypa.io/get-pip.py
peilin@PWN:~/Desktop$ python2 get-pip.py

Okay, now I have Python 2 pip. However, after pip installing ply, spdxcheck.py complained again that I didn’t have git. Ugh… I didn’t want to bother with this anymore, so I simply did sudo ln -fs /usr/bin/python3 /usr/bin/python, then (re)installed ply and gitpython for my Python 3.


It seems that this patch (checkpatch: Allow users to specify the python command to use) from Palmer Dabbelt tried to add an option to checkpatch, so that we can do something like scripts/checkpatch.pl --python=python3 -f $FILE, but unfortunately it didn’t come true.