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

执行demo脚本报cffi.VerificationError: CompileError: command '/usr/bin/clang' failed with exit code 1 #15

Open
micheryu opened this issue Aug 17, 2023 · 1 comment

Comments

@micheryu
Copy link

大佬好,运行demo中的脚本
from videocr import get_subtitles

if name == 'main': # This check is mandatory for Windows.

print(get_subtitles(
    video_path='2.mp4', lang='ch', time_start='0:00', time_end='',
    conf_threshold=75, sim_threshold=80, use_fullframe=False,
    det_model_dir=None, rec_model_dir=None, use_gpu=False,
    brightness_threshold=None, similar_image_threshold=100, similar_pixel_threshold=25, frames_to_skip=1,
    crop_x=None, crop_y=None, crop_width=None, crop_height=None))

报lmdb的版本问题我已经通过brew安装了arm版本的lmdb了,其中cffi包也通过brew重新安装过;请问这个是什么异常?
image

/Users/mac/miniforge3/envs/py3.8/lib/python3.8/site-packages/lmdb/pycache/lmdb_cffi.c:268:14: fatal error: 'preload.h' file not found
#include "preload.h"
^~~~~~~~~~~
1 error generated.
Traceback (most recent call last):
File "/Users/mac/miniforge3/envs/py3.8/lib/python3.8/site-packages/lmdb/init.py", line 42, in
from lmdb.cpython import *
ImportError: dlopen(/Users/mac/miniforge3/envs/py3.8/lib/python3.8/site-packages/lmdb/cpython.cpython-38-darwin.so, 0x0002): tried: '/Users/mac/miniforge3/envs/py3.8/lib/python3.8/site-packages/lmdb/cpython.cpython-38-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/mac/miniforge3/envs/py3.8/lib/python3.8/site-packages/lmdb/cpython.cpython-38-darwin.so' (no such file), '/Users/mac/miniforge3/envs/py3.8/lib/python3.8/site-packages/lmdb/cpython.cpython-38-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/mac/miniforge3/envs/py3.8/lib/python3.8/site-packages/setuptools/_distutils/unixccompiler.py", line 185, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
File "/Users/mac/miniforge3/envs/py3.8/lib/python3.8/site-packages/setuptools/_distutils/ccompiler.py", line 1041, in spawn
spawn(cmd, dry_run=self.dry_run, **kwargs)
File "/Users/mac/miniforge3/envs/py3.8/lib/python3.8/site-packages/setuptools/_distutils/spawn.py", line 70, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/usr/bin/clang' failed with exit code 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/mac/miniforge3/envs/py3.8/lib/python3.8/site-packages/cffi/ffiplatform.py", line 51, in _build
dist.run_command('build_ext')
File "/Users/mac/miniforge3/envs/py3.8/lib/python3.8/site-packages/setuptools/dist.py", line 1234, in run_command
super().run_command(command)
File "/Users/mac/miniforge3/envs/py3.8/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/Users/mac/miniforge3/envs/py3.8/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 84, in run
_build_ext.run(self)
File "/Users/mac/miniforge3/envs/py3.8/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
self.build_extensions()
File "/Users/mac/miniforge3/envs/py3.8/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 467, in build_extensions
self._build_extensions_serial()
File "/Users/mac/miniforge3/envs/py3.8/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 493, in _build_extensions_serial
self.build_extension(ext)
File "/Users/mac/miniforge3/envs/py3.8/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 246, in build_extension
_build_ext.build_extension(self, ext)
File "/Users/mac/miniforge3/envs/py3.8/lib/python3.8/site-packages/Cython/Distutils/build_ext.py", line 127, in build_extension
super(build_ext, self).build_extension(ext)
File "/Users/mac/miniforge3/envs/py3.8/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 548, in build_extension
objects = self.compiler.compile(
File "/Users/mac/miniforge3/envs/py3.8/lib/python3.8/site-packages/setuptools/_distutils/ccompiler.py", line 600, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
File "/Users/mac/miniforge3/envs/py3.8/lib/python3.8/site-packages/setuptools/_distutils/unixccompiler.py", line 187, in _compile
raise CompileError(msg)
distutils.errors.CompileError: command '/usr/bin/clang' failed with exit code 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/mac/Desktop/workspace/aigc/demo/main.py", line 6, in
from videocr import get_subtitles
File "/Users/mac/miniforge3/envs/py3.8/lib/python3.8/site-packages/videocr/init.py", line 2, in
from .api import get_subtitles, save_subtitles_to_file
File "/Users/mac/miniforge3/envs/py3.8/lib/python3.8/site-packages/videocr/api.py", line 1, in
from .video import Video
File "/Users/mac/miniforge3/envs/py3.8/lib/python3.8/site-packages/videocr/video.py", line 9, in
from paddleocr import PaddleOCR
File "/Users/mac/miniforge3/envs/py3.8/lib/python3.8/site-packages/paddleocr/init.py", line 14, in
from .paddleocr import *
File "/Users/mac/miniforge3/envs/py3.8/lib/python3.8/site-packages/paddleocr/paddleocr.py", line 48, in
from tools.infer import predict_system
File "/Users/mac/miniforge3/envs/py3.8/lib/python3.8/site-packages/paddleocr/tools/infer/predict_system.py", line 33, in
import tools.infer.predict_det as predict_det
File "/Users/mac/miniforge3/envs/py3.8/lib/python3.8/site-packages/paddleocr/tools/infer/predict_det.py", line 31, in
from ppocr.data import create_operators, transform
File "/Users/mac/miniforge3/envs/py3.8/lib/python3.8/site-packages/paddleocr/ppocr/data/init.py", line 37, in
from ppocr.data.lmdb_dataset import LMDBDataSet, LMDBDataSetSR, LMDBDataSetTableMaster
File "/Users/mac/miniforge3/envs/py3.8/lib/python3.8/site-packages/paddleocr/ppocr/data/lmdb_dataset.py", line 17, in
import lmdb
File "/Users/mac/miniforge3/envs/py3.8/lib/python3.8/site-packages/lmdb/init.py", line 48, in
from lmdb.cffi import *
File "/Users/mac/miniforge3/envs/py3.8/lib/python3.8/site-packages/lmdb/cffi.py", line 372, in
_lib = _ffi.verify(_CFFI_VERIFY,
File "/Users/mac/miniforge3/envs/py3.8/lib/python3.8/site-packages/cffi/api.py", line 468, in verify
lib = self.verifier.load_library()
File "/Users/mac/miniforge3/envs/py3.8/lib/python3.8/site-packages/cffi/verifier.py", line 105, in load_library
self._compile_module()
File "/Users/mac/miniforge3/envs/py3.8/lib/python3.8/site-packages/cffi/verifier.py", line 202, in _compile_module
outputfilename = ffiplatform.compile(tmpdir, self.get_extension())
File "/Users/mac/miniforge3/envs/py3.8/lib/python3.8/site-packages/cffi/ffiplatform.py", line 22, in compile
outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
File "/Users/mac/miniforge3/envs/py3.8/lib/python3.8/site-packages/cffi/ffiplatform.py", line 58, in _build
raise VerificationError('%s: %s' % (e.class.name, e))
cffi.VerificationError: CompileError: command '/usr/bin/clang' failed with exit code 1

@devmaxxing
Copy link
Owner

安装videocr前你有没有先安装对的paddlepaddle版本?
https://www.paddlepaddle.org.cn/install/quick?docurl=/documentation/docs/zh/install/pip/macos-pip.html

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