[Qgis-user] PyQGIS from non-bundled Python install?

Andrew Hughes ahhughes at gmail.com
Wed Jun 8 00:36:23 PDT 2022


Thanks Ujaval,

I was just about to respond as I found this:
https://docs.qgis.org/3.4/en/docs/pyqgis_developer_cookbook/intro.html#running-custom-applications

Your method looks completely different to that documented above. As I've
already started with the above method, I will continue unless I exhaust
that as an option.

I managed to get a docker image running (debian)  with qgis installed,
however these values I am using are no doubt wrong.
ENV PYTHONPATH=/usr/share/qgis/python
ENV LD_LIBRARY_PATH=/usr/lib/qgis

Could anyone suggest how I might find the correct values? At this stage,
python is not finding the packages "qgis.core.Qgis" == module not found

Thanks in advance,
Andrew



On Wed, 8 Jun 2022 at 17:12, Ujaval Gandhi <ujaval at spatialthoughts.com>
wrote:

> Yes. Configuring system paths to point to qgis libraries will allow native
> python to work with pyqgis. I have a complete example for Mac which can be
> easily adapted for a linux based system.
>
> https://courses.spatialthoughts.com/pyqgis-in-a-day.html#writing-standalone-python-scripts
> [image: Logo] <https://spatialthoughts.com/>
> Ujaval Gandhi
> Spatial Thoughts
> mobile: +91-8095684687
> email: ujaval at spatialthoughts.com
> [image: LinkedIn icon] <https://www.linkedin.com/in/spatialthoughts/>  [image:
> Twitter icon] <https://twitter.com/spatialthoughts>
>
>
>
> On Wed, Jun 8, 2022 at 7:25 AM Andrew Hughes via Qgis-user <
> qgis-user at lists.osgeo.org> wrote:
>
>> Hi All,
>>
>> Q: Is it possible to have a system/native python install work with
>> PyQGIS?
>>
>> Finer Details: I am working with Azure Functions. Their base
>> (container/docker) image includes a python install. I can provide a custom
>> docker image, thus I can set system paths and run all the instructions as
>> per this
>> https://qgis.org/en/site/forusers/alldownloads.html#debian-ubuntu so
>> that QGIS is installed on the container. But, I doubt my (function) app can
>> be configured to run a-top of the QGIS python install that is bundled with
>> QGIS.
>>
>> Also, I don't know if conda is an option - would prefer to assume not at
>> this point in time as that doesn't align with local development tooling
>> that is based on venv.
>>
>> Things I am hoping to see:
>> Yes - but you need to set a PATH.... or PYTHONPATH....
>> Yes - but need to see ..... in requirements.txt
>> No - impossible, fill your boots....
>>
>> Thanks for reading
>> Andrew
>>
>>
>>
>> _______________________________________________
>> Qgis-user mailing list
>> Qgis-user at lists.osgeo.org
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20220608/29615fd5/attachment.htm>


More information about the Qgis-user mailing list