Code Monkey home page Code Monkey logo

Comments (9)

jstockwin avatar jstockwin commented on July 24, 2024

Hey @rannndom, apologies for the slow response - I've been away.

Could you check you're using the most recent version (0.8.0)?

Additionally, is that the full traceaback? I don't see the actual error included there.

from py-pdf-parser.

drakbar avatar drakbar commented on July 24, 2024

@jstockwin
I am having the same issue

from py_pdf_parser.loaders import load_file
from py_pdf_parser.visualise import visualise

document = load_file("simple_memo.pdf")
visualise(document)

Running it results in the same traceback as rannndom. This is missing part in the tracback.
TypeError: use() got an unexpected keyword argument 'warn'

I can confirm that I am on version 0.8.0.

pip freeze | findstr py-pdf-parser
py-pdf-parser==0.8.0

from py-pdf-parser.

jstockwin avatar jstockwin commented on July 24, 2024

Hi @drakbar and @rannndom,

Apologies, I thought a fix for this was included in 0.8.0, but it was not.

I've just published a new release, 0.9.0. Please could you try that out and let me know if it works?

from py-pdf-parser.

drakbar avatar drakbar commented on July 24, 2024

@jstockwin
I did a similar change on my local copy of 0.8.0 prior to you pushing out that update.
I am not sure if you made any other changes.

matplotlib.use("Qt5Agg")  # noqa

I believe I ran into this same stack trace though.
After updating to 0.9.0:

Traceback (most recent call last):
  File "C:\Users\developer\Desktop\pec\parse.py", line 2, in <module>
    from py_pdf_parser.visualise import visualise
  File "C:\Users\developer\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\py_pdf_parser\visualise\__init__.py", line 1, in <module>
    from .main import visualise
  File "C:\Users\developer\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\py_pdf_parser\visualise\main.py", line 8, in <module>
    from matplotlib import pyplot as plt
  File "C:\Users\developer\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\matplotlib\pyplot.py", line 2500, in <module>
    switch_backend(rcParams["backend"])
  File "C:\Users\developer\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\matplotlib\pyplot.py", line 277, in switch_backend
    class backend_mod(matplotlib.backend_bases._Backend):
  File "C:\Users\developer\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\matplotlib\pyplot.py", line 278, in backend_mod
    locals().update(vars(importlib.import_module(backend_name)))
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1520.0_x64__qbz5n2kfra8p0\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "C:\Users\developer\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\matplotlib\backends\backend_qt5agg.py", line 11, in <module>
    from .backend_qt5 import (
  File "C:\Users\developer\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\matplotlib\backends\backend_qt5.py", line 13, in <module>
    import matplotlib.backends.qt_editor.figureoptions as figureoptions
  File "C:\Users\developer\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\matplotlib\backends\qt_editor\figureoptions.py", line 11, in <module>
    from matplotlib.backends.qt_compat import QtGui
  File "C:\Users\developer\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\matplotlib\backends\qt_compat.py", line 179, in <module>
    raise ImportError("Failed to import any qt binding")
ImportError: Failed to import any qt binding

I don't have qt on this setup.

from py-pdf-parser.

jstockwin avatar jstockwin commented on July 24, 2024

@drakbar have you installed the dev version of the requirements (i.e. pip3 install py-pdf-parser[dev])? You need to do this to install pyqt5, so that could be the issue.

See if you can run:

>>> import matplotlib
>>> matplotlib.use("qt5agg")
>>> from matplotlib import pyplot as plt

from py-pdf-parser.

drakbar avatar drakbar commented on July 24, 2024

Yeah I didn't have that package. An additional dependency of py-pdf-parser[dev], is MSVC++ Build Tools.
I don't have time for all that right now, I will have to revisit this at a later date.

from py-pdf-parser.

jstockwin avatar jstockwin commented on July 24, 2024

Fair enough, sorry to hear that it's not going to work for you.

Unfortunately, the visualise tool will only work with those, and this is why I have it as a dev dependency.

To be clear, the rest of this package will work without it, i.e. you can do everything except call visualise without those dependencies. However, visualise is one of the really helpful features when writing these things.

from py-pdf-parser.

jstockwin avatar jstockwin commented on July 24, 2024

I am fairly sure the issue itself (i.e. the TypeError: use() got an unexpected keyword argument 'warn') is fixed in 0.9.0, so I am closing this issue. Feel free to re-open if I am wrong.

Happy to have a look at dependencies at some point, but that'll be a different issue.

from py-pdf-parser.

jstockwin avatar jstockwin commented on July 24, 2024

An additional dependency of py-pdf-parser[dev], is MSVC++ Build Tools.

FYI Version 0.10.0 switches out PyQt5 for Tkinter, which might reduce these additional requirements.

from py-pdf-parser.

Related Issues (20)

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.