[QGIS-Developer] Deploy plugin by setting QGIS_PLUGINPATH

Zhang Qun zhangq.rhy at gmail.com
Thu Nov 16 19:17:48 PST 2017


Hi Richard,

Thank you for the detailed explanation. I can check the variable value in
Option/System tab and now it worked.

I found I need to set the variable to the parent folder of my plugin and
check the plugin manager list as you suggested.

Thank you.

Best regards,
Zhang Qun

On Thu, Nov 16, 2017 at 8:25 PM, Richard Duivenvoorde <rdmailings at duif.net>
wrote:

> I think what Zhang Qun is asking if he can use a custom directory to
> store his plugin in.
> If I grep in the source dir of QGIS I see a lot of references to
> QGIS_PLUGINPATH, so it should work.
> I also see in the changelog that is there since 2010 (and a lot of fixes
> for windows environments....)
>
> Do you seen the QGIS_PLUGINPATH in the Options/System tab?
>
> Also does it not show up in the plugin list of the plugin manager?
> Because if you install a plugin by copying it to the plugin dir (even
> the default one), it is not enabled by default. So IF shown, enable it
> in the plugin manager first.
>
> FYI: grepping:
>
> grep -ir QGIS_PLUGINPATH *
> Binary file
> build/src/python/CMakeFiles/qgispython.dir/qgspythonutilsimpl.cpp.o
> matches
> build/doc/news:- Support for custom plugin directories using
> QGIS_PLUGINPATH environment
> build/doc/news.html:<LI>Support for custom plugin directories using
> QGIS_PLUGINPATH environment
> Binary file build/output/lib/libqgispython.so.2.18.14 matches
> ChangeLog:    Fix windows path escaping for QGIS_PLUGINPATH
> ChangeLog:    Fix windows path escaping for QGIS_PLUGINPATH
> ChangeLog:    skip empty parts of QGIS_PLUGINPATH
> ChangeLog:    don't split QGIS_PLUGINPATH at colon on windows
> ChangeLog:    Additionally, plugin paths in QGIS_PLUGINPATH can be
> separated by either semicolon or colon.
> ChangeLog:    [FEATURE] support for custom plugin directories using
> QGIS_PLUGINPATH environment variables.
> doc/news.html:<LI>Support for custom plugin directories using
> QGIS_PLUGINPATH environment
> doc/news.t2t:- Support for custom plugin directories using
> QGIS_PLUGINPATH environment
> NEWS:- Support for custom plugin directories using QGIS_PLUGINPATH
> environment
> src/python/qgspythonutilsimpl.h:    //! return a list of extra plugins
> paths passed with QGIS_PLUGINPATH environment variable
> src/python/qgspythonutilsimpl.cpp:  // plugin dirs passed in
> QGIS_PLUGINPATH env. variable have highest priority (usually empty)
> src/python/qgspythonutilsimpl.cpp:  const char* cpaths = getenv(
> "QGIS_PLUGINPATH" );
> tests/src/python/test_qgsappstartup.py:            # when it is started.
> if QGIS_PLUGINPATH is correctly parsed, this
> tests/src/python/test_qgsappstartup.py:
> env={'QGIS_PLUGINPATH': testDir})
>
> HTH,
>
> Richard DUivenvoorde
>
> On 16-11-17 11:47, Patrick Dunford wrote:
> > There are sometimes reasons why this method may not work (I think Ubuntu
> > does have a particular limitation in this regard)
> >
> > One option is you can create a shortcut on the menu and pass the
> > variable value in that shortcut.
> >
> > For example one of the Qgis shortcuts on the Whiskers menu in XFCE on my
> > computer uses this command to start a version of Qgis that I built from
> > source and installed to a different path:
> >
> > env LD_LIBRARY_PATH=/home/patrick/apps/lib /home/patrick/apps/bin/qgis
> >
> > where env is passing that variable into the environment that Qgis starts
> > with.
> >
> > On 16/11/17 23:33, Zhang Qun wrote:
> >> Dear all,
> >>
> >> I want to use the |QGIS_PLUGINPATH| environment variable to point to
> >> the directory where my plugin are located but did not manage to get it
> >> work.
> >>
> >> I'm on Ubuntu16.04 and running QGIS 2.18.
> >>
> >> I set the variable in terminal by:
> >> $ export QGIS_PLUGINPATH=~/QGIS_Plugins/rndf-editor/RNDFEditor/
> >>
> >> and launch the QGIS in this terminal (I guess in order to get the
> >> variable effective I have to run within the terminal right?)
> >>
> >> $ qgis
> >>
> >> But my plugin still did not get to show under the manu Plugin.
> >>
> >> Can anyone advise me the correct way to do it? Thanks.
> >>
> >> Best regards,
> >> Zhang Qun
> >>
> >>
> >> _______________________________________________
> >> QGIS-Developer mailing list
> >> QGIS-Developer at lists.osgeo.org
> >> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> >> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> >
> >
> >
> > _______________________________________________
> > QGIS-Developer mailing list
> > QGIS-Developer at lists.osgeo.org
> > List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> >
>
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20171117/7742ab59/attachment.html>


More information about the QGIS-Developer mailing list