(1) you should use sudo
to run the script. Without sudo
it may give error message.
sudo ./optimize-gain.py
.
(2) If using sudo
does not solve your problem, then copy-paste applicable script from this post:
Copy-Paste Gain Optimization Scripts From Here (4 versions for 4 different types of installs)
.
I have just now run script #3 on Raspbian Stretch with dump1090-mutability, and it is working fine.
pi@raspberrypi:~ $ sudo ./optimize-gain.py
test 1 of 5
gain= 49.6 messages= 17257 positions= 1230 planes= 66
gain= 48.0 messages= 18778 positions= 1421 planes= 72
.......
.......
EDIT:
Tested script # 1 on Piaware SD Card image 3.6.2 (which is Stretch), works ok.
pi@piaware:~ $ sudo ./optimize-gain.py
test 1 of 5
gain= 49.6 messages= 15376 positions= 1379 planes= 65
gain= 48.0 messages= 15609 positions= 1392 planes= 65
............
............