Skip to content

Issue with wand import not being found #67

Description

@kevflynn
  • pydngconverter version: latest
  • Python version: 3.10
  • Operating System: Mac OS Silicon

Description

I am trying to run the example code on my machine to convert a raw file to a DNG and I'm getting an error about the wand import not being found

What I Did

Code

import asyncio
import sys
from pydngconverter import DNGConverter, flags


async def main():
    # Create converter instance.
    pydng = DNGConverter(
        sys.argv[1],
        dest="/dngfiles",
        jpeg_preview=flags.JPEGPreview.EXTRACT,
        fast_load=True,
    )
    # Convert all
    return await pydng.convert()


loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.close()

Command

python dngconvert.py public/test.ARW

Traceback

/Users/flynn/Documents/labs/pixellabs/pixel/dngconvert.py:18: DeprecationWarning: There is no current event loop
  loop = asyncio.get_event_loop()
[10:41:18] INFO     pydngconverter.utils: resolved executable for: Adobe DNG Converter @ /Applications/Adobe compat.py:151
                    DNG Converter.app/Contents/MacOS/Adobe DNG Converter                                                  
           INFO     pydngconverter.utils: resolved executable for: exiftool @ /opt/homebrew/bin/exiftool     compat.py:151
Traceback (most recent call last):
  File "/Users/flynn/anaconda3/lib/python3.10/site-packages/wand/api.py", line 154, in <module>
    libraries = load_library()
  File "/Users/flynn/anaconda3/lib/python3.10/site-packages/wand/api.py", line 143, in load_library
    raise IOError('cannot find library; tried paths: ' + repr(tried_paths))
OSError: cannot find library; tried paths: []

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/flynn/anaconda3/lib/python3.10/site-packages/pydngconverter/main.py", line 17, in <module>
    from wand.image import Image
  File "/Users/flynn/anaconda3/lib/python3.10/site-packages/wand/image.py", line 18, in <module>
    from . import assertions
  File "/Users/flynn/anaconda3/lib/python3.10/site-packages/wand/assertions.py", line 155, in <module>
    from .color import Color  # noqa: E402
  File "/Users/flynn/anaconda3/lib/python3.10/site-packages/wand/color.py", line 10, in <module>
    from .api import library
  File "/Users/flynn/anaconda3/lib/python3.10/site-packages/wand/api.py", line 178, in <module>
    raise ImportError('MagickWand shared library not found.\n'
ImportError: MagickWand shared library not found.
You probably had not installed ImageMagick library.
Try to install:
  brew install freetype imagemagick

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/flynn/Documents/labs/pixellabs/pixel/dngconvert.py", line 19, in <module>
    loop.run_until_complete(main())
  File "/Users/flynn/anaconda3/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/Users/flynn/Documents/labs/pixellabs/pixel/dngconvert.py", line 8, in main
    pydng = DNGConverter(
  File "/Users/flynn/anaconda3/lib/python3.10/site-packages/pydngconverter/main.py", line 90, in __init__
    raise RuntimeError(
RuntimeError: Cannot use JPEG Preview EXTRACT because wand failed to import!
Warning: imagemagick 7.1.1-9 is already installed and up-to-date.
To reinstall 7.1.1-9, run:
  brew reinstall imagemagick

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