[Qgis-user] installing python packages in pyQGIS in Mac

Asim asimrp at lavabit.com
Fri May 20 22:20:24 PDT 2022


On 5/20/22 7:23 PM, Guillermo D'Angelo via Qgis-user wrote:
>
> What would be the propper way to install new packages via pip in the 
> QGIS Python in Mac SO?
>
> This way didn't work: pip.main(['install', 'boto3'])


The Python bundled within QGIS app needs to be used for this.  I have 
QGIS 3.16 on my Mac and the Python is within it is located at 
$QGIS_PREFIX_PATH/bin, which is:

     /Applications/QGIS-LTR.app/Contents/MacOS/bin

I was able to install "boto3" successfully with the following command:

     export QGIS_PREFIX_PATH=/Applications/QGIS-LTR.app/Contents/MacOS
     export PATH=$QGIS_PREFIX_PATH/bin:$PATH
     pip3 install boto3

Asim




More information about the Qgis-user mailing list