<!DOCTYPE html><html><head><title></title></head><body><div>Unfortunatley that doesn’t work for me either.</div><div><br></div><div>It fails with the following error:</div><div><br></div><div>Traceback (most recent call last):</div><div>  File "<input>", line 1, in <module></div><div>  File "Untitled-0", line 13, in <module></div><div>  File "Untitled-0", line 11, in install</div><div>  File "/Applications/QGIS <a href="http://4.app/Contents/Frameworks/lib/python3.12/subprocess.py">4.app/Contents/Frameworks/lib/python3.12/subprocess.py</a>", line 413, in check_call</div><div>    raise CalledProcessError(retcode, cmd)</div><div>subprocess.CalledProcessError: Command '['/Applications/QGIS <a href="http://4.app/Contents/MacOS/python">4.app/Contents/MacOS/python</a>', '-m', 'pip', 'install', 'matplotlib']' returned non-zero exit status 126.</div><div><br></div><div><br></div><div><br></div><div>On Sat, 14 Mar 2026, at 10:25 PM, Ujaval Gandhi wrote:</div><blockquote type="cite" id="qt" style=""><div dir="ltr"><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><div>import sys</div><div>from pathlib import Path</div><div><br></div><div># Get the root directory with our applications</div><div>python_dir = Path(sys.executable).parent</div><div><br></div><div>python_executable = python_dir / "python"</div><div><br></div><div>def install(package):</div><div>    subprocess.check_call([str(python_executable), "-m", "pip", "install", package])</div><div><br></div><div>install("yourpackage")</div></div><div><br></div><div><div dir="ltr" class="qt-gmail_signature"><div dir="ltr"><div>---</div><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><div><br></div></div><div><br></div><div class="qt-gmail_quote qt-gmail_quote_container"><div dir="ltr" class="qt-gmail_attr">On Fri, Mar 13, 2026 at 5:52 AM Josh Mawer via QGIS-User <qgis-user@lists.osgeo.org> wrote:</div><blockquote class="qt-gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204, 204, 204);padding-left:1ex;"><div><u></u><br></div><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><div>______________________________<wbr>_________________</div><div> QGIS-User mailing list</div><div> <a href="mailto:QGIS-User@lists.osgeo.org" target="_blank">QGIS-User@lists.osgeo.org</a></div><div> 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></div><div> 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></div></blockquote></div><div><img width="0" height="0" class="qt-mailtrack-img" alt="" style="display:flex;" src="https://mailtrack.io/trace/mail/w/am1hd2VyQGZhc3RtYWlsLmNvbQ/dccbcf982c01601878cbad7e8e405676de545cee.png?u=8747767"><br></div></blockquote><div><br></div></body></html>