CausalDiscoveryToolbox
CausalDiscoveryToolbox copied to clipboard
[BUG] Importing cdt breaks matplotlib due to qt library error
Describe the bug importing cdt and matplotlib in the wrong order creates a Qt library inconsistency
the following code works:
import sys
import cdt
import seaborn
import matplotlib.pyplot as plt
print("python",sys.version)
for mod in ['matplotlib','torch','cdt','seaborn']:
m=sys.modules.get(mod,None)
print(mod,m.__version__)
plt.plot([1],[1])
and it outputs
python 3.7.1 (default, Oct 28 2018, 08:39:03) [MSC v.1912 64 bit (AMD64)]
No GPU automatically detected. Setting SETTINGS.GPU to 0, and SETTINGS.NJOBS to cpu_count.
matplotlib 3.3.2
torch 1.4.0
cdt 0.5.23
seaborn 0.11.1
But if the cdt
import comes after either the seaborn or the matplotlib imports, then I get the error
Cannot mix incompatible Qt library (version 0x50906) with this library (version 0x50907)
cdt is installed via PyPI, all other packages via conda
This is strange, I'll look into it, maybe to remove the matplotlib/seaborn import; Thanks for the feedback