Code Monkey home page Code Monkey logo

python_fontconfig's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

python_fontconfig's Issues

Could not find module 'libfontconfig.so.1'

I installed python_config, but when I try to import the librairy in a file, I get this error:

Traceback (most recent call last):
  File "fontCollector.py", line 402, in <module>
    import fontconfig as fc
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\fontconfig.py", line 35, in <module>
    fc = ct.cdll.LoadLibrary("libfontconfig.so.1")
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\ctypes\__init__.py", line 451, in LoadLibrary
    return self._dlltype(name)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\ctypes\__init__.py", line 373, in __init__
    self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'libfontconfig.so.1' (or one of its dependencies). Try using the full path with constructor syntax.

I am on windows, so it is probably the reason why I have this issues.

Undefined symbols in in libfontconfig.so.1 when used on Ubuntu 18.04

It appears python_fontconfig requires a newer version of libfontconfig under Ubuntu 18.04.

After installing python_fontconfig using pip, I can't import the module due to missing symbol FcConfigFileInfoIterInit.

$ ipython
Python 3.6.9 (default, Nov  7 2019, 10:44:02) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.15.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import fontconfig as fc                                                               
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-1-e5f1b0bd6fa9> in <module>
----> 1 import fontconfig as fc

~/.virtualenvs/test/lib/python3.6/site-packages/fontconfig.py in <module>
    574 fc.FcConfigSetSysRoot.restype = None
    575 fc.FcConfigSetSysRoot.argtypes = (ct.c_void_p, ct.c_void_p)
--> 576 fc.FcConfigFileInfoIterInit.restype = None
    577 fc.FcConfigFileInfoIterInit.argtypes = (ct.c_void_p, ct.c_void_p)
    578 fc.FcConfigFileInfoIterNext.restype = FC.Bool

/usr/lib/python3.6/ctypes/__init__.py in __getattr__(self, name)
    359         if name.startswith('__') and name.endswith('__'):
    360             raise AttributeError(name)
--> 361         func = self.__getitem__(name)
    362         setattr(self, name, func)
    363         return func

/usr/lib/python3.6/ctypes/__init__.py in __getitem__(self, name_or_ordinal)
    364 
    365     def __getitem__(self, name_or_ordinal):
--> 366         func = self._FuncPtr((name_or_ordinal, self))
    367         if not isinstance(name_or_ordinal, int):
    368             func.__name__ = name_or_ordinal

AttributeError: /usr/lib/x86_64-linux-gnu/libfontconfig.so.1: undefined symbol: FcConfigFileInfoIterInit

Installed in Python3.6.9 virtualenv on Ubuntu 18.04. libfontconfig info:

$ apt show libfontconfig1
Package: libfontconfig1
Version: 2.12.6-0ubuntu2
Priority: optional
Section: libs
Source: fontconfig
Origin: Ubuntu
Maintainer: Ubuntu Developers <[email protected]>

According to the fontconfig docs that symbol is available since version 2.12.91 so I assume I need to install a newer version of libfontconfig.

And indeed, the symbol doesn't exist in the installed libfontconfig.so.1

$ nm -gD /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 | grep ConfigFile
000000000000ce00 T FcConfigFilename
000000000000adb0 T FcConfigGetConfigFiles

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.