Giter Club home page Giter Club logo

Comments (5)

HareInWeed avatar HareInWeed commented on June 6, 2024 1

fixed in 815e20b

from pdf-toc.

HareInWeed avatar HareInWeed commented on June 6, 2024

I think this is because PyMuPDF has changed the method name of Document.getToC into Document.get_toc, as the manual says.

I will release a new version of pdf-toc to fix the issue as soon as I have some spare time. For now, you can manually downgrade the PyMuPDF to an older version. PyMuPDF == 1.18.15 should be working.

from pdf-toc.

Mia-Dan avatar Mia-Dan commented on June 6, 2024

When I try using PyMuPDF==1.18.15, the 'Document' object has no attribute 'getToC' error disappears, but another error occurs. Is there anything I can do with that?

Traceback (most recent call last):
  File "/opt/anaconda3/envs/sklearn_38/bin/pdf-toc", line 5, in <module>
    from src.main import main
  File "/opt/anaconda3/envs/sklearn_38/lib/python3.8/site-packages/src/__init__.py", line 1, in <module>
    from .main import main
  File "/opt/anaconda3/envs/sklearn_38/lib/python3.8/site-packages/src/main.py", line 6, in <module>
    import fitz
  File "/opt/anaconda3/envs/sklearn_38/lib/python3.8/site-packages/fitz/__init__.py", line 10, in <module>
    from fitz.fitz import *
  File "/opt/anaconda3/envs/sklearn_38/lib/python3.8/site-packages/fitz/fitz.py", line 15, in <module>
    from . import _fitz
ImportError: dlopen(/opt/anaconda3/envs/sklearn_38/lib/python3.8/site-packages/fitz/_fitz.cpython-38-darwin.so, 2): Symbol not found: ____chkstk_darwin
  Referenced from: /opt/anaconda3/envs/sklearn_38/lib/python3.8/site-packages/fitz/_fitz.cpython-38-darwin.so
  Expected in: /usr/lib/libSystem.B.dylib
 in /opt/anaconda3/envs/sklearn_38/lib/python3.8/site-packages/fitz/_fitz.cpython-38-darwin.so

from pdf-toc.

HareInWeed avatar HareInWeed commented on June 6, 2024

When I try using PyMuPDF==1.18.15, the 'Document' object has no attribute 'getToC' error disappears, but another error occurs. Is there anything I can do with that?

Traceback (most recent call last):
  File "/opt/anaconda3/envs/sklearn_38/bin/pdf-toc", line 5, in <module>
    from src.main import main
  File "/opt/anaconda3/envs/sklearn_38/lib/python3.8/site-packages/src/__init__.py", line 1, in <module>
    from .main import main
  File "/opt/anaconda3/envs/sklearn_38/lib/python3.8/site-packages/src/main.py", line 6, in <module>
    import fitz
  File "/opt/anaconda3/envs/sklearn_38/lib/python3.8/site-packages/fitz/__init__.py", line 10, in <module>
    from fitz.fitz import *
  File "/opt/anaconda3/envs/sklearn_38/lib/python3.8/site-packages/fitz/fitz.py", line 15, in <module>
    from . import _fitz
ImportError: dlopen(/opt/anaconda3/envs/sklearn_38/lib/python3.8/site-packages/fitz/_fitz.cpython-38-darwin.so, 2): Symbol not found: ____chkstk_darwin
  Referenced from: /opt/anaconda3/envs/sklearn_38/lib/python3.8/site-packages/fitz/_fitz.cpython-38-darwin.so
  Expected in: /usr/lib/libSystem.B.dylib
 in /opt/anaconda3/envs/sklearn_38/lib/python3.8/site-packages/fitz/_fitz.cpython-38-darwin.so

I am not sure what exactly happened here. It seems to be an upstream issue where PyMuPDF is not installed correctly. pymupdf/PyMuPDF#1296 could be related. You can try to reinstall PyMuPDF or update pip before installation.

This could be specific to some older versions of PyMuPDF through. Perhaps the issue will be resolved automatically in the upcoming version of pdf-toc. Let me know if the problem persists then.

from pdf-toc.

Mia-Dan avatar Mia-Dan commented on June 6, 2024

Thanks for your help, unfortunately updating pip and reinstalling PyMuPDF didn't fix the issue. Anyway, I'm watching for the upcoming version of pdf-toc. ;)

from pdf-toc.

Related Issues (3)

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.