Python 3.x Python Wand缺少库/路径

Python 3.x Python Wand缺少库/路径,python-3.x,wand,Python 3.x,Wand,我正在尝试安装Python3的Wand,对我来说,可以通过我的Cygwin安装访问它 我首先尝试安装魔杖: # Install Wand #-------------- # https://docs.wand-py.org/en/0.6.6/guide/install.html $ python -m pip install Wand Defaulting to user installation because normal site-packages is not writeable Col

我正在尝试安装Python3的Wand,对我来说,可以通过我的Cygwin安装访问它

我首先尝试安装魔杖:

# Install Wand
#--------------
# https://docs.wand-py.org/en/0.6.6/guide/install.html
$ python -m pip install Wand
Defaulting to user installation because normal site-packages is not writeable
Collecting Wand
  Downloading Wand-0.6.6-py2.py3-none-any.whl (138 kB)
     |████████████████████████████████| 138 kB 1.5 MB/s
Installing collected packages: Wand
Successfully installed Wand-0.6.6
WARNING: You are using pip version 21.0; however, version 21.0.1 is available.
You should consider upgrading via the '/bin/python -m pip install --upgrade pip' command.
然后我尝试导入图像,但出现错误:

# Try importing from Wand
#------------------------
# https://docs.wand-py.org/en/0.6.6/guide/read.html#open-an-image-file
$ python
>>> from wand.image import Image
Traceback (most recent call last):
  File "/home/User.Name/.local/lib/python3.8/site-packages/wand/api.py", line 151, in <module>
    libraries = load_library()
  File "/home/User.Name/.local/lib/python3.8/site-packages/wand/api.py", line 140, 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 "<stdin>", line 1, in <module>
  File "/home/User.Name/.local/lib/python3.8/site-packages/wand/image.py", line 18, in <module>
    from . import assertions
  File "/home/User.Name/.local/lib/python3.8/site-packages/wand/assertions.py", line 155, in <module>
    from .color import Color  # noqa: E402
  File "/home/User.Name/.local/lib/python3.8/site-packages/wand/color.py", line 10, in <module>
    from .api import library
  File "/home/User.Name/.local/lib/python3.8/site-packages/wand/api.py", line 175, 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:
  https://docs.wand-py.org/en/latest/guide/install.html
已确认的魔杖安装:

$ls -l ~/.local/lib/python3.8/site-packages/*
/home/User.Name/.local/lib/python3.8/site-packages/wand:
total 601
-rw-------  1 User.Name None    202 2021-04-18 01:04 __init__.py
drwx------+ 1 User.Name None      0 2021-04-18 01:04 __pycache__/
-rw-------  1 User.Name None   9844 2021-04-18 01:04 api.py
-rw-------  1 User.Name None   4721 2021-04-18 01:04 assertions.py
drwx------+ 1 User.Name None      0 2021-04-18 01:04 cdefs/
-rw-------  1 User.Name None  24508 2021-04-18 01:04 color.py
-rw-------  1 User.Name None   4570 2021-04-18 01:04 compat.py
-rw-------  1 User.Name None   2449 2021-04-18 01:04 display.py
-rw-------  1 User.Name None  77010 2021-04-18 01:04 drawing.py
-rw-------  1 User.Name None  11165 2021-04-18 01:04 exceptions.py
-rw-------  1 User.Name None   4021 2021-04-18 01:04 font.py
-rw-------  1 User.Name None 412660 2021-04-18 01:04 image.py
-rw-------  1 User.Name None  11663 2021-04-18 01:04 resource.py
-rw-------  1 User.Name None  13183 2021-04-18 01:04 sequence.py
-rw-------  1 User.Name None  10453 2021-04-18 01:04 version.py

/home/User.Name/.local/lib/python3.8/site-packages/Wand-0.6.6.dist-info:
total 15
-rw------- 1 User.Name None    4 2021-04-18 01:04 INSTALLER
-rw------- 1 User.Name None 1183 2021-04-18 01:04 LICENSE
-rw------- 1 User.Name None 3850 2021-04-18 01:04 METADATA
-rw------- 1 User.Name None 3406 2021-04-18 01:04 RECORD
-rw------- 1 User.Name None    0 2021-04-18 01:04 REQUESTED
-rw------- 1 User.Name None    5 2021-04-18 01:04 top_level.txt
-rw------- 1 User.Name None  110 2021-04-18 01:04 WHEEL
文件的时间戳与文件的大致时间匹配 安装

已确认
sys.path
包含
~/.local/lib/python3.8/站点包

$ python
>>> import sys
>>> for path in sys.path:
...    print(path)
... 

/usr/lib/python38.zip
/usr/lib/python3.8
/usr/lib/python3.8/lib-dynload
/home/User.Name/.local/lib/python3.8/site-packages
/usr/lib/python3.8/site-packages

这个答案可能有助于:


检查系统上的python版本是32位还是64位。如果您有32位版本,请尝试安装64位版本,然后检查。

我的Cygwin安装是64位的,因此所有
ImageMagick
MagickWand
库也是64位的。
pip
不会寻找64位
魔杖吗?我如何确定安装的
pip
-棒
是否为64位?
$ python
>>> import sys
>>> for path in sys.path:
...    print(path)
... 

/usr/lib/python38.zip
/usr/lib/python3.8
/usr/lib/python3.8/lib-dynload
/home/User.Name/.local/lib/python3.8/site-packages
/usr/lib/python3.8/site-packages