What you probably want is Arduino Portable mode. But unfortunately it's not supported on MacOS.

I believe the main problem you're seeing is any library you install into...