<div dir="ltr"><div><div><div><div><div><div>Salve a tutti,<br><br></div>qualcuno sa come si risolve il problema delle librerie esterne richieste dai plugin ?<br><br></div>Dove vanno inserite ?   Si possono inserire all'interno del plugin, invece di doverle inserire all'interno di ogni nuova versione di QGIS, come ad esempio :<br><br>QGIS VERSIONE\apps\Python27\Lib\site-packages\<br><br>?<br><br></div>A proposito di questo, di seguito c'è il messaggio di Victor Olaya che ho trovato all'interno della lista qgis-dev ,  ma non riesco a far funzionare le sue istruzioni.   Qualcuno può aiutarmi ?  :)    Penso sia un problema che interessa parecchi sviluppatori di plugin.<br><br><br></div>Grazie per qualunque info in proposito<br><br></div>A presto<br><br></div>Roberto<br><div><div><div><div><br><br><div><div><div><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Geo DrinX</b> <span dir="ltr"><<a href="mailto:geodrinx@gmail.com">geodrinx@gmail.com</a>></span><br>Date: 2015-10-21 15:28 GMT+02:00<br>Subject: Re: [Qgis-developer] Plugin Dependencies<br>To: Victor Olaya <<a href="mailto:volayaf@gmail.com">volayaf@gmail.com</a>><br>Cc: qgis-developer <<a href="mailto:qgis-developer@lists.osgeo.org">qgis-developer@lists.osgeo.org</a>><br><br><br><div dir="ltr">Ola Victor !  :)<br><div><div class="gmail_extra"><br><div class="gmail_quote"><span class="">2015-10-07 17:50 GMT+02:00 Victor Olaya <span dir="ltr"><<a href="mailto:volayaf@gmail.com" target="_blank">volayaf@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">At the moment, you have to ship them with your plugin, in the plugin<br>
zip file. If the lib uses native code, you will need to include<br>
binaries for all OSs that you want to support, and the corresponding<br>
mechanism to pick one or the other.<br>
<br>
As an example, you can see how it is done in this plugin<br>
<br>
<a href="https://github.com/boundlessgeo/qgis-geoserver-plugin/blob/master/src/geoserverexplorer/__init__.py" rel="noreferrer" target="_blank">https://github.com/boundlessgeo/qgis-geoserver-plugin/blob/master/src/geoserverexplorer/__init__.py</a><br>
<br>
Dependencies are stored in a folder called "ext-libs", which is added<br>
to the python path by the plugin<br>
<br>
Notice that that folder is not in the repo, there is a paver task to<br>
fetch the dependencies from PyPi<br>
<br>
Notice also that QGIS has its folder with python libs<br>
<br>
<a href="https://github.com/qgis/QGIS/tree/master/python/ext-libs" rel="noreferrer" target="_blank">https://github.com/qgis/QGIS/tree/master/python/ext-libs</a><br>
<br>
Make sure that the libs you require are not already in there</blockquote><div><br><br></div></span><div>In my case ( GEarthView QGIS plugin )  I have  two external libraries:<br><br></div><div>twisted<br></div><div>zope<br><br><br></div><div>that I need to install manually  :( <br><br></div><div>On windows,  they need to be copied for each new version of QGIS, inside the folder:<br><br>QGIS VERSION\apps\Python27\Lib\site-packages\<br><br><br></div><div>Instead, on MacOSX, they are  (<span lang="en"><span>once and for all</span></span>)  inside the standard  python  library folder, as I explained in my blog:<br></div><div><br><a href="http://exporttocanoma.blogspot.it/2015/01/gearthview-20-plugin-per-qgis.html" target="_blank">http://exporttocanoma.blogspot.it/2015/01/gearthview-20-plugin-per-qgis.html</a> <br><br><br></div><div><span lang="en"><span>I have</span> <span>tried several times</span> <span>to</span> <span>make sure that</span> <span>it was not necessary</span> <span>to install anything</span><span>,</span> <span>including</span> <span>the libraries</span> <span>in my</span> <span>plugins</span><span>,</span> <span>so far</span> <span>I have not succeeded</span><span>.   </span></span><span lang="en"><span>So</span><span>,</span> <span>that</span> <span>your</span> <span>message</span> <span>has rekindled</span> <span>my hopes  :)    </span></span><span lang="en"><span>but</span> <span>there are some things</span> <span>I do not understand</span><span>,</span> <span>in your</span> <span>explanation  (</span></span><span lang="en"><span><span lang="en"><span>my fault</span></span>).<br><br></span></span></div><div><span lang="en"><span>Here are my steps:<br><br></span></span></div><div><span lang="en"><span>1) I modified my  geodrinx/__init__.py      adding:<br><br></span></span></div><div><span lang="en"><span>site.addsitedir(os.path.abspath(os.path.dirname(__file__) + '/ext-libs'))<br></span></span></div><div><br></div><div>Question:  where need I to create this  <span lang="en"><span>ext-libs   folder ?    </span></span><span lang="en"><span><span lang="en"><span>I looked into the</span> <span>plugin</span> <span>that you indicate</span><span>,</span> <span>but</span> <span>I found no</span> <span>"</span><span>ext</span><span>-</span><span>libs</span><span>"</span> <span>folder.<br><br></span></span></span></span></div><div><span lang="en"><span><span lang="en"><span>Could you please explain me (us)  better ?<br><br><br></span></span></span></span></div><div><span lang="en"><span><span lang="en"><span>Thank you much<br><br></span></span></span></span></div><div><span lang="en"><span><span lang="en"><span>A presto<br><br></span></span></span></span></div><div><span lang="en"><span><span lang="en"><span>Roberto<br></span></span> </span></span></div><div><br></div></div></div></div></div>
</div><br></div></div></div></div></div></div></div></div>