When I change the first line of the script to #! /usr/bin/env python3, then no error will be reported, but the log message is not output and the script is not running
If you have changed the environment directory permissions
sudo chmod -R a+X /home/pi/miniforge3/envs/freePbx
sudo chmod -R a+r /home/pi/miniforge3/envs/freePbx
No such file or directory will be reported:
Change the first line of the script to #! /usr/bin/env python3, the error is not reported, the script did not run because of the Window newline (CRLF, \r\n), not Unix-style newline (LF, \n), The only problem is that if the first line is changed to a python environment created by conda, the Permission denied will be displayed. How do I set the permission so that I can restart the Raspberry PI without having to set it again
I thought Conda was a Windows thing: there shouldn’t be any need to use it on Linux.
On Linux, I would recommend you stick to the system Python installation (/usr/bin/python3). If you need some small number of additional Python packages that are not available in the standard repos, you can install them into /usr/local/lib/pythonver/dist-packages/ with pip. Anything more complicated that that might require virtualenv.
After I restarted Raspberry PI, agi won’t work again, I use #! /usr/bin/env python, and pip install pyyaml, I still can not run, there is no error, I directly execute./sms_handler.py can run, but the agi command can not run, there is no error in the log, how do I install this module,I guess because pyyaml is not installed in the asterisk environment, how do I install it?
When Asterisk spawns your AGI process, it sets stdout and stderr to /dev/null. You can restore a more useful stderr destination by putting something like