<div dir="ltr" gmail_original="1"><div>Hi Josh,</div><div><br></div><div>Use the snippet below. This was suggested by Matthias Kuhn in this discussion. <a href="https://github.com/qgis/QGIS/issues/63939#issuecomment-3621819919.">https://github.com/qgis/QGIS/issues/63939#issuecomment-3621819919.</a> Tested and works fine on QGIS 4.0.0 on Mac</div><div><br></div><div>import subprocess</div><div>import sys<br>from pathlib import Path<br><br># Get the root directory with our applications<br>python_dir = Path(sys.executable).parent<br><br>python_executable = python_dir / "python"<br><br>def install(package):<br>    subprocess.check_call([str(python_executable), "-m", "pip", "install", package])<br><br>install("yourpackage")</div><div><br></div><div><div dir="ltr" class="gmail_signature"><div dir="ltr">---<div>Ujaval Gandhi</div><div>Spatial Thoughts</div><div><a href="http://www.spatialthoughts.com" target="_blank">www.spatialthoughts.com</a></div><div><br></div></div></div></div><br></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Fri, Mar 13, 2026 at 5:52 AM Josh Mawer via QGIS-User <qgis-user@lists.osgeo.org> wrote:<br></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><u></u><div><div>Hi QGIS User List,</div><div><br></div><div>I am developing a python based QGIS processing script which is working great on a Windows installation.  However, when I try to run it on my Mac I get an error stating the Matplotlib package is not installed in the python environment.</div><div><br></div><div>How can I install additional packages into the QGIS python environment?  I have found a few old StackOverflow threads mentioning installing via Pip3 from within the QGIS Application Package.  However, Pip3 doesn't seem to be contained there any more.</div><div><br></div><div>Any thoughts? Thanks,</div></div>______________________________<wbr>_________________<br>
QGIS-User mailing list<br>
<a href="mailto:QGIS-User@lists.osgeo.org" target="_blank">QGIS-User@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailma<wbr>n/listinfo/qgis-user</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailma<wbr>n/listinfo/qgis-user</a><br>
</blockquote></div>
<img width="0" height="0" class="mailtrack-img" alt="" style="display:flex" src="https://mailtrack.io/trace/mail/w/cWdpcy11c2VyQGxpc3RzLm9zZ2VvLm9yZw/dccbcf982c01601878cbad7e8e405676de545cee.png?u=8747767" >