[英]OSError: [WinError 193] %1 is not a valid Win32 application (LibTiff)
I need to use libtiff
for a project.我需要为一个项目使用
libtiff
。
pip install libtiff
pip install libtiff
C:\\Program Files\\GnuWin32\\bin
C:\\Program Files\\GnuWin32\\bin
After doing these steps, when I am running import libtiff, the following error is coming:完成这些步骤后,当我运行 import libtiff 时,会出现以下错误:
OSError Traceback (most recent call last)
<ipython-input-1-3fa0885ae753> in <module>
20 import os
21 import pickle
---> 22 from libtiff import TIFF
23 import libtiff
24 libtiff.libtiff_ctypes.suppress_warnings()
c:\users\ajain7\appdata\local\programs\python\python36\lib\site-packages\libtiff\__init__.py in <module>
18 __all__ = ['TIFF', 'TIFF3D', 'TIFFfile', 'TiffArray', 'TiffFile', 'TiffFiles', 'TiffChannelsAndFiles', 'TiffBase']
19
---> 20 from .libtiff_ctypes import libtiff, TIFF, TIFF3D
21 from .tiff import TIFFfile, TIFFimage, TiffArray
22 from .tiff_file import TiffFile
c:\users\ajain7\appdata\local\programs\python\python36\lib\site-packages\libtiff\libtiff_ctypes.py in <module>
48 'PATH|LD_LIBRARY_PATH|..')
49
---> 50 libtiff = ctypes.cdll.LoadLibrary(lib)
51
52 libtiff.TIFFGetVersion.restype = ctypes.c_char_p
c:\users\ajain7\appdata\local\programs\python\python36\lib\ctypes\__init__.py in LoadLibrary(self, name)
424
425 def LoadLibrary(self, name):
--> 426 return self._dlltype(name)
427
428 cdll = LibraryLoader(CDLL)
c:\users\ajain7\appdata\local\programs\python\python36\lib\ctypes\__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error)
346
347 if handle is None:
--> 348 self._handle = _dlopen(self._name, mode)
349 else:
350 self._handle = handle
OSError: [WinError 193] %1 is not a valid Win32 application
Another thing might have happened.可能发生了另一件事。 VS code automatically searches for the numpy and other packages from predefined OS locations.
VS Code 会自动从预定义的操作系统位置搜索 numpy 和其他包。 You might be using the 32 bit version of numpy instead of a 64 bit version.
您可能使用的是 32 位版本的 numpy 而不是 64 位版本。 To fix this, uninstall
libtiff
from all locations by typing pip uninstall libtiff
为了解决这个问题,卸载
libtiff
通过键入的所有位置pip uninstall libtiff
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.