Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running PAWLS on MacOS M1 Machine #197

Open
sanjanachin opened this issue Jan 24, 2023 · 3 comments
Open

Running PAWLS on MacOS M1 Machine #197

sanjanachin opened this issue Jan 24, 2023 · 3 comments

Comments

@sanjanachin
Copy link

Hi!

I'm trying to use PAWLS to collect PDF annotations, but the pawls command is not working when I try to follow the installation on MacOS. Specifically, after running:

$ pawls

I get the following response:

Traceback (most recent call last):
  File "/opt/homebrew/bin/pawls", line 33, in <module>
    sys.exit(load_entry_point('pawls==0.0.1', 'console_scripts', 'pawls')())
  File "/opt/homebrew/bin/pawls", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/opt/homebrew/Cellar/[email protected]/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
    module = import_module(match.group('module'))
  File "/opt/homebrew/Cellar/[email protected]/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/opt/homebrew/lib/python3.10/site-packages/pawls-0.0.1-py3.10.egg/pawls/__main__.py", line 3, in <module>
    from pawls import commands
  File "/opt/homebrew/lib/python3.10/site-packages/pawls-0.0.1-py3.10.egg/pawls/commands/__init__.py", line 1, in <module>
    from pawls.commands.preprocess import preprocess
  File "/opt/homebrew/lib/python3.10/site-packages/pawls-0.0.1-py3.10.egg/pawls/commands/preprocess.py", line 10, in <module>
    from pawls.preprocessors.pdfplumber import process_pdfplumber
  File "/opt/homebrew/lib/python3.10/site-packages/pawls-0.0.1-py3.10.egg/pawls/preprocessors/pdfplumber.py", line 4, in <module>
    import pdfplumber
  File "/opt/homebrew/lib/python3.10/site-packages/pdfplumber-0.7.6-py3.10.egg/pdfplumber/__init__.py", line 14, in <module>
    from .pdf import PDF
  File "/opt/homebrew/lib/python3.10/site-packages/pdfplumber-0.7.6-py3.10.egg/pdfplumber/pdf.py", line 9, in <module>
    from pdfminer.pdfdocument import PDFDocument
  File "/opt/homebrew/lib/python3.10/site-packages/pdfminer-20191125-py3.10.egg/pdfminer/pdfdocument.py", line 10, in <module>
    from Crypto.Cipher import ARC4
  File "/opt/homebrew/lib/python3.10/site-packages/pycryptodome-3.16.0-py3.10-macosx-12-arm64.egg/Crypto/Cipher/__init__.py", line 27, in <module>
    from Crypto.Cipher._mode_ecb import _create_ecb_cipher
  File "/opt/homebrew/lib/python3.10/site-packages/pycryptodome-3.16.0-py3.10-macosx-12-arm64.egg/Crypto/Cipher/_mode_ecb.py", line 35, in <module>
    raw_ecb_lib = load_pycryptodome_raw_lib("Crypto.Cipher._raw_ecb", """
  File "/opt/homebrew/lib/python3.10/site-packages/pycryptodome-3.16.0-py3.10-macosx-12-arm64.egg/Crypto/Util/_raw_api.py", line 309, in load_pycryptodome_raw_lib
    raise OSError("Cannot load native module '%s': %s" % (name, ", ".join(attempts)))
OSError: Cannot load native module 'Crypto.Cipher._raw_ecb': Not found '_raw_ecb.cpython-310-darwin.so', Cannot load '_raw_ecb.abi3.so': cannot load library '/opt/homebrew/lib/python3.10/site-packages/pycryptodome-3.16.0-py3.10-macosx-12-arm64.egg/Crypto/Util/../Cipher/_raw_ecb.abi3.so': dlopen(/opt/homebrew/lib/python3.10/site-packages/pycryptodome-3.16.0-py3.10-macosx-12-arm64.egg/Crypto/Util/../Cipher/_raw_ecb.abi3.so, 0x0002): tried: '/opt/homebrew/lib/python3.10/site-packages/pycryptodome-3.16.0-py3.10-macosx-12-arm64.egg/Crypto/Util/../Cipher/_raw_ecb.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/local/lib/_raw_ecb.abi3.so' (no such file), '/usr/lib/_raw_ecb.abi3.so' (no such file), '/opt/homebrew/lib/python3.10/site-packages/pycryptodome-3.16.0-py3.10-macosx-12-arm64.egg/Crypto/Cipher/_raw_ecb.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/local/lib/_raw_ecb.abi3.so' (no such file), '/usr/lib/_raw_ecb.abi3.so' (no such file).  Additionally, ctypes.util.find_library() did not manage to locate a library called '/opt/homebrew/lib/python3.10/site-packages/pycryptodome-3.16.0-py3.10-macosx-12-arm64.egg/Crypto/Util/../Cipher/_raw_ecb.abi3.so', Not found '_raw_ecb.so'

When I used the same installation procedure on a Ubuntu machine, everything worked normally, and I was able to use this process to add custom PDFs.

But, I am now unable to export any annotations because the pawls command is not working.

Any ideas?

Thanks!

@soldni
Copy link
Member

soldni commented Jan 24, 2023

@sanjanachin are you currently using an Apple Silicon Machine (e.g. M1 MacBook Pro)?

@sanjanachin
Copy link
Author

@soldni Yes, I'm using an M1 Mac.

@soldni
Copy link
Member

soldni commented Jan 24, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants