QGIS plugin external libraries in plugin’s directory

by Edoardo Pessina   Last Updated October 29, 2018 15:22 PM

I’m developing my first QGIS plugin and I have to use two external libraries not included in the default OSGeoW64 installation: Couchdb and Pandas.

I would like to include those libraries in my plugin’s directory so that users don’t have to deal with the installation of them.

So I created a folder called lib, inserted in it an empty _init_.py and downloaded in it the libraries using pip:

python3 -m pip install -t lib couchdb

The directory looks like this:

|--- lib
     |--- bin
     |--- couchdb 
     |--- CouchDB-1.2.dist-info
     |--- _init_.py
|--- _init_.py
|--- mhyconos.py

In mhyconos.py I imported couchdb using

from lib import couchdb 

but when I install the plugin, this is what happens:

enter image description here

What am I doing wrong?

Related Questions

Updated April 06, 2017 03:22 AM

Updated July 05, 2018 05:22 AM

Updated February 25, 2016 01:09 AM

Updated December 03, 2018 21:22 PM

Updated September 28, 2016 08:09 AM