Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Fontconfig error: Cannot load default config file" on Ubuntu 16.04

I'm using python 2.7 on Anaconda, on Ubuntu 16.04, installed in a virtual machine with VMware Player on Windows 10.

When running the following code, I get the following error:

>>> import networkx as nx
>>> G = nx.complete_graph(4)
>>> pos = nx.nx_pydot.graphviz_layout(G)
Fontconfig error: Cannot load default config file

I have tried setting the path as suggested here, both in the root and on the conda environment, I have tried to reinstall fontconfig both in the root and on the conda environment, and I have also tried the answer suggested here, and I have exited the console, and restart the machine several times, and I still get the same error.

I will very much appreciate any help to solve this problem.

like image 442
Rafael Caro Avatar asked Dec 18 '22 10:12

Rafael Caro


1 Answers

The following fixed it for me:

export FONTCONFIG_FILE=$CONDA_PREFIX/etc/fonts/fonts.conf
export FONTCONFIG_PATH=$CONDA_PREFIX/etc/fonts/

EDIT: Can you try it again? There were two '\' too much.

like image 145
Joachim Wolff Avatar answered Apr 29 '23 00:04

Joachim Wolff