title: How to run external QT program from PyQT5 on MacOS
body: <p>When trying to run a QT program from PyQT5 the external program crashes and says that <code>qt.qpa.plugin: Could not load the Qt platform plugin &quot;{a platform}&quot; in &quot;&quot; even though it was found.</code> This is probably because it is trying to load 2 sets of libraries, one from my app and one from the external programs.</p>
  <p>On Windows this can be fix by setting <code>QT_QPA_PLATFORM_PLUGIN_PATH</code> to the plugin path in the folder, but on MacOS I can't seem to get it working on MacOS, is there an easier way of running a program in PyQT5 than this?</p>
  <p>By the way, the program I am trying to run is the Dolphin Emulator.</p>
  <p>Windows Code:</p>
  <pre><code>env = os.environ
  env[&quot;QT_QPA_PLATFORM_PLUGIN_PATH&quot;] = os.path.dirname(programPath)+'/QtPlugins/platforms/'
  subprocess.Popen(programPath,env=env)
  </code></pre>
  <p>MacOS Code:</p>
  <pre><code>env = os.environ
  env[&quot;QT_QPA_PLATFORM_PLUGIN_PATH&quot;] = programPath+'/Contents/MacOS/platforms/'
  subprocess.Popen(programPath+'/Contents/MacOS/Dolphin',env=env)
  </code></pre>