New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't get launchctl working #3
Comments
It sounds like you've installed the requests module as a different user that the lauchctl user is using and it can't find it. Can you confirm when you installed the requests module that you were logged in as /users/serveruser ? Which user are you logged in as when you can successfully run the script from terminal - is it serveruser? What does "pip3 show requests" display when you are able to run it from terminal - this will show where requests has been installed. Hopefully this might give you some clues. Cheers |
Thank you for trying to help. Everything I've done has been under serveruser. I first of all installed Python3, then pip via
Thanks again. |
Fixed it. Instead of loading Python3 from /usr/bin, I now load it from /usr/local/bin, and everything's fine. I have absolutely no idea why it exists in both places! |
Great to see that you fixed it. It would be interesting to see what’s displayed when you type “which Python3” from terminal. Macs really are a royal pain in the rear lol, I’ve had so many issues over the years cause it’s not a real Unix system and Apple do things differently . I’m seriously considering dumping mine and going for a Linux system. I might enable bootcamp on the Mac and see if I can just run Mint or another similar OS. |
That gets If you live in Unix/Linux, i can understand why you might want a native install. I’m sure someone’s done that using Boot Camp. EDIT: Ah, everything Python-related in /usr/local/bin is an alias to the real thing in the Frameworks path, so at least that makes sense. No idea what the executable is in the /usr/bin path is. |
Interesting - which python3 reports |
But what’s in your |
My Mac is a hot mess - |
Yeh, probably a good time to rebuild after 15 years, painful as that can be sometimes. However, I don't think your setup is that different from mine.
So the Python and Node installations seem to add the latest version to the PATH, but I originally launched python3 from |
Yes, PATH adds another layer of complexity lol - I wasn't able to install paho-mqtt via |
Well mine’s not that pretty either, and I’ve only just installed Python! |
Well that didn't take long. I now have Home Assistant and this script running on a MacMini that I formatted and is running Linux Mint as the only OS. I had it up and running in a few hours, it was so much easier than fighting MACOS. |
Nice. Horses for courses! |
Just a thought. Do you think it would be possible for this script to run as an add-on or integration in home assistant? |
I hope it's ok to ask here for help. I can run the script very successfully from MacOS Terminal, using
python3 /users/serveruser/Envoy_scripts/envoy_mqtt_script.py
but I'm having a lot of trouble getting it to run via launchctl. My plist is:
When I load it, the stderr.log shows
Now when I first started playing with this, the "requests" module was missing on my system, and I installed it and all was well via Terminal (or Python3 Launcher). But the problem is back when I use launchctl. Any ideas?
The text was updated successfully, but these errors were encountered: