<html><head></head><body><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></body></html>