<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hey Robert :)</p>
<p>tl;dr: Check this out ->
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/pipermail/qgis-developer/2022-April/064661.html">https://lists.osgeo.org/pipermail/qgis-developer/2022-April/064661.html</a></p>
<p>This question has been asked many times but because mailing lists
are ... special ... the discussions around it are spread across
tens of messages, accessible via arcane and hard-to-navigate
websites that might not even be indexed nicely by search engines.<br>
</p>
<p>Anyways, just some days ago this was discussed once again on the
qgis-developer list:
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/pipermail/qgis-developer/2022-April/064661.html">https://lists.osgeo.org/pipermail/qgis-developer/2022-April/064661.html</a></p>
<p>In this case you are lucky that the discussion has not gone into
another month yet so you should be able to click on "Next message
(by thread)" to see the discussion bit-by-bit. I'd recommend
checking the threaded view too though
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/pipermail/qgis-developer/2022-April/thread.html">https://lists.osgeo.org/pipermail/qgis-developer/2022-April/thread.html</a>
because someone might have decided to branch off into another
thread with a different mail subject.</p>
<p>If you want to reply, you cannot use your account on the
qgis-user mailing list but have to register once again.<br>
</p>
<p>No, I don't like mailing lists, thanks for asking! >:( ;)<br>
</p>
<p>Cheers, Hannes<br>
</p>
<p><br>
</p>
<div class="moz-cite-prefix">Am 19.04.22 um 23:08 schrieb
nagyrobi_r--- via Qgis-user:<br>
</div>
<blockquote type="cite"
cite="mid:1731563740.786805.1650402523190@mail.yahoo.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div class="yahoo-style-wrap" style="font-family:times new roman,
new york, times, serif;font-size:13px;">
<div dir="ltr" data-setdir="false">Hei everybody!</div>
<div dir="ltr" data-setdir="false"><br>
</div>
<div dir="ltr" data-setdir="false">I am trying to develop a QGIS
plugin, and the plugin requires python modules that are not
present in the basic QGIS python install. Since i want these
packages to install for users that might wish to use the
plugin, what method would be the correct one to install the
dependencies? I am thinking that some users might have
multiple python installs at once, multiple pythonpaths etc.</div>
<div dir="ltr" data-setdir="false"><br>
</div>
<div dir="ltr" data-setdir="false">1. Method using setup.py when
installing the module. But how would that run? or when would
it run? Very open for suggestions here.</div>
<div dir="ltr" data-setdir="false">2. Using subprocess with a
try and except clause: prone for errors, since any python
instance might be called :
<div>
<div> import sys</div>
<div> import subprocess</div>
<div><br>
</div>
<div> # implement pip as a subprocess:</div>
<div> subprocess.check_call(['python', '-m', 'pip',
'install', </div>
<div> '<packagename>'])</div>
</div>
</div>
<div dir="ltr" data-setdir="false">3. Using pip.main, which
seems to warn about a deprecation possibilities for the future</div>
<div dir="ltr" data-setdir="false">
<div>
<div>import pip</div>
<div>pip.main(['install', package])</div>
</div>
<br>
</div>
<div dir="ltr" data-setdir="false">Method 1 could run one time
at the plugin install, whilst methods 2 and 3 would run at
every plugin load.</div>
<div dir="ltr" data-setdir="false">How do you go about adding
dependencies to your package?</div>
<div dir="ltr" data-setdir="false"><br>
</div>
<div dir="ltr" data-setdir="false">Kind regards,</div>
<div dir="ltr" data-setdir="false">Robert Nagy</div>
<div dir="ltr" data-setdir="false"><br>
</div>
</div>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Qgis-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a>
List info: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
Unsubscribe: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
Johannes Kröger / GIS-Entwickler/-Berater
---------------------------------------------
Schon gewusst?
In unserem Blog geben wir Tipps & Tricks zu Open-Source-GIS-Software
und berichten aus unserem Experten-Alltag:
<a class="moz-txt-link-freetext" href="https://wheregroup.com/blog/">https://wheregroup.com/blog/</a>
---------------------------------------------
WhereGroup GmbH
Grevenweg 89
20537 Hamburg
Germany
Tel: +49 (0)228 / 90 90 38 - 36
Fax: +49 (0)228 / 90 90 38 - 11
<a class="moz-txt-link-abbreviated" href="mailto:johannes.kroeger@wheregroup.com">johannes.kroeger@wheregroup.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.wheregroup.com">www.wheregroup.com</a>
Geschäftsführer:
Olaf Knopp, Peter Stamm
Amtsgericht Bonn, HRB 9885
-------------------------------
</pre>
</body>
</html>