1

I am building a QGIS plugin and I'd like to import a module named python-ternary. I have a specific issue importing this module (others get imported), and importing it in QGIS (works outside of QGIS).

I installed it using pip, tried to import it outside of QGIS, works fine.

Now writing this in my plugin main file:

from qgis.PyQt.QtCore import QSettings, QTranslator, QCoreApplication, Qt
from qgis.PyQt.QtGui import QIcon, QColor
from qgis.PyQt.QtWidgets import QAction, QApplication

from .resources import *

import psycopg2
import ternary

I get this when loading my plugin with the QGIS plugin manager:

QGIS error when loading the plugin

Now the python-ternary module is well installed in lib\site-packages: ternary file in lib\site-packages

And lib\site-packages is on path as shown in the QGIS error.

I have no problem importing other modules in QGIS e.g. psycopg2 is imported without issue. I force reinstalled python-ternary with pip, to no avail.

Is there a compatibility issue with this particular module I'm not aware of ?

0 Answers0