# Problem running pymupdf



## rainer_d (Oct 28, 2019)

Hi,

pymupdf does compile (in a virtualenv), but when I try to use it:


```
(mu) (python-test <mu>) 0 # python
Python 2.7.16 (default, Oct 23 2019, 15:53:49)
[GCC 4.2.1 Compatible FreeBSD Clang 8.0.0 (tags/RELEASE_800/final 356365)] on freebsd11
Type "help", "copyright", "credits" or "license" for more information.
>>> import fitz
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/root/mu/lib/python2.7/site-packages/fitz/__init__.py", line 3, in <module>
    from fitz.fitz import *
  File "/root/mu/lib/python2.7/site-packages/fitz/fitz.py", line 18, in <module>
    from . import _fitz
ImportError: /usr/local/lib/libmupdf.so.1.16.0: Undefined symbol "FT_Get_Advance"
```

mupdf itself is build from the 2019Q4 cut in a FreeBSD amd64 11.3 jail on a poudriere server (running 12.0).


What does that error mean? How can this be fixed?



Rainer


----------



## mark_j (Oct 30, 2019)

Speaking generally, you probably have dependency issues. Assuming you're doing the install from ports, run portsnap fetch update. Once completed run portsnap fetch install


----------



## rainer_d (Oct 30, 2019)

Yes, I solved it in the meantime.
One has to manually add libfreetype and libharfbuzz in the list of libraries to link against in setup.py.

I have an issue open on the projects github pages so this gets added and it works for FreeBSD out of the box.

My customer who actually needs this says that for his case, those two libraries are enough.

However, I wonder if I need to link against everything else that mupdf (mu-tools) is linked against, which is quite a lot?


----------



## SirDice (Oct 31, 2019)

mark_j said:


> Assuming you're doing the install from ports, run portsnap fetch update. Once completed run portsnap fetch install


There is no `install` for portsnap(8). A `portsnap fetch update` is enough to fetch and update the ports tree and is exactly the same as running `portsnap fetch && portsnap update`.


----------



## bjs (Oct 31, 2019)

You can also just use `portsnap auto`


----------

