Skip to content

AttributeError: module 'diff_match_patch' has no attribute 'diff' #39

@horror-vacui

Description

@horror-vacui
 $ pdf-diff journal.pdf journal_v3.pdf > comparison.png
Traceback (most recent call last):
  File "/usr/local/bin/pdf-diff", line 10, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/dist-packages/pdf_diff/command_line.py", line 497, in main
    changes = compute_changes(args.files[0], args.files[1], top_margin=float(args.top_margin), bottom_margin=float(args.bottom_margin))
  File "/usr/local/lib/python3.6/dist-packages/pdf_diff/command_line.py", line 17, in compute_changes
    diff = perform_diff(docs[0][1], docs[1][1])
  File "/usr/local/lib/python3.6/dist-packages/pdf_diff/command_line.py", line 122, in perform_diff
    return diff_match_patch.diff(
AttributeError: module 'diff_match_patch' has no attribute 'diff'

 $ pip3 install diff_match_patch
Requirement already satisfied: diff_match_patch in /usr/local/lib/python3.6/dist-packages (20181111)

I've got the the problem above on a Xubuntu 18.04.3 LTS machine witch python 3.6. pdf-diff version 0.9.1 was installed through pip. I am not sure how to debug it further, or what further information are needed to diagnose the error.

Python 3.6.8 (default, Oct  7 2019, 12:59:55) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import diff_match_patch
>>> dir(diff_match_patch)
['__author__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__packager__', '__path__', '__spec__', '__version__', 'diff_match_patch', 'patch_obj', 'sys']

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions