checkpatch.pl
When I run checkpatch.pl I get the following message that clutters the output with a lot of traceback lines. Obviously, it makes its output a bit harder to read and it annoys me, however it seems that the script does its work and spots the violations of the coding rules.
lines ...-... Traceback (most recent call last):
File "scripts/spdxcheck.py", line 6, in <module>
from ply import lex, yacc
ImportError: No module named ply
What I understand is that a Python script, that is called spdxcheck.py and that is called by checkpatch.pl (Perl calling Python, lovely... :)), can't find a module called "ply".
My laptop runs openSuSE Tumbleweed. It has two directories named "ply", one in /usr/lib/python3.8/site-packages/pycparser/ and the other in /usr/lib/python3.8/site-packages/. "zipper" (the openSuSE package manager) says that I have two packages already installed: python38-ply and python-ply-doc (Python Lex and Yacc), therefore I suppose I have the modules that checkpatch->spdxcheck is looking for but it cannot find them (missing environment variable?).
Can someone, please, help me to solve this issue?
Thanks,
Fabio
Hi Fabio,
It seems that the script uses python2, so you need to install "python-ply" package.
среда, 7 апреля 2021 г. в 10:10:40 UTC+3, [email protected]:
Quoted 30 lines
When I run checkpatch.pl I get the following message that clutters the output with a lot of traceback lines. Obviously, it makes its output a bit harder to read and it annoys me, however it seems that the script does its work and spots the violations of the coding rules.
lines ...-... Traceback (most recent call last):
File "scripts/spdxcheck.py", line 6, in <module>
from ply import lex, yacc
ImportError: No module named plyWhat I understand is that a Python script, that is called
spdxcheck.pyand that is called by checkpatch.pl (Perl calling Python, lovely... :)), can't find a module called "ply".My laptop runs openSuSE Tumbleweed. It has two directories named "ply", one in
/usr/lib/python3.8/site-packages/pycparser/and the other in/usr/lib/python3.8/site-packages/. "zipper" (the openSuSE package manager) says that I have two packages already installed: python38-ply and python-ply-doc (Python Lex and Yacc), therefore I suppose I have the modules thatcheckpatch->spdxcheckis looking for but it cannot find them (missing environment variable?).Can someone, please, help me to solve this issue?
Thanks,
Fabio
Hi Igor,
Quoted 6 lines · CEST Igor Zhbanov
Hi Fabio,
It seems that the script uses python2, so you need to install "python-ply" package.
Quoted 1 line
[...]
Thanks for your reply, though I've already been able to solve this problem some months ago :-)
It was only due to checkpatch.pl not able to find where "python-ply" had been (correctly) installed. All that I had to do was to make a symbolic link to the target directory where the module resides.
Regards,
Fabio