pdfGPT
pdfGPT copied to clipboard
lc-serve on Macbook M1/M2
i have a MacBook M2 and this problem when trying to launch:
(venv_pdfGPT) ~/pdfGPT/ [main*] lc-serve deploy local api
⠋ Waiting ... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0/1 -:--:--ERROR gateway/rep-0@20705 ImportError("dlopen(/Users/andi/pdfGPT/venv_pdfGPT/lib/python3.11/site-packages/fitz/_fitz.so, 0x0002): [08/23/23 20:08:36]
tried: '/Users/andi/pdfGPT/venv_pdfGPT/lib/python3.11/site-packages/fitz/_fitz.so' (mach-o file, but is an incompatible
architecture (have 'x86_64', need 'arm64')),
'/System/Volumes/Preboot/Cryptexes/OS/Users/andi/pdfGPT/venv_pdfGPT/lib/python3.11/site-packages/fitz/_fitz.so' (no such file),
'/Users/andi/pdfGPT/venv_pdfGPT/lib/python3.11/site-packages/fitz/_fitz.so' (mach-o file, but is an incompatible architecture
(have 'x86_64', need 'arm64'))") during 'GatewayRuntime' initialization
add "--quiet-error" to suppress the exception details
Traceback (most recent call last):
File "/Users/andi/pdfGPT/venv_pdfGPT/lib/python3.11/site-packages/jina/orchestrate/pods/init.py", line 89, in run
runtime = AsyncNewLoopRuntime(
^^^^^^^^^^^^^^^^^^^^
File "/Users/andi/pdfGPT/venv_pdfGPT/lib/python3.11/site-packages/jina/serve/runtimes/asyncio.py", line 81, in init
self._loop.run_until_complete(self.async_setup())
File "/Users/andi/pdfGPT/venv_pdfGPT/lib/python3.11/site-packages/nest_asyncio.py", line 99, in run_until_complete
return f.result()
^^^^^^^^^^
File "/opt/homebrew/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/futures.py",
line 203, in result
raise self._exception.with_traceback(self._exception_tb)
File "/opt/homebrew/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/tasks.py",
line 267, in __step
result = coro.send(None)
^^^^^^^^^^^^^^^
File "/Users/andi/pdfGPT/venv_pdfGPT/lib/python3.11/site-packages/jina/serve/runtimes/asyncio.py", line 255, in async_setup
self.server = self._get_server()
^^^^^^^^^^^^^^^^^^
File "/Users/andi/pdfGPT/venv_pdfGPT/lib/python3.11/site-packages/jina/serve/runtimes/asyncio.py", line 159, in _get_server
return BaseGateway.load_config(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/andi/pdfGPT/venv_pdfGPT/lib/python3.11/site-packages/jina/jaml/init.py", line 792, in load_config
obj = JAML.load(tag_yml, substitute=False, runtime_args=runtime_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/andi/pdfGPT/venv_pdfGPT/lib/python3.11/site-packages/jina/jaml/init.py", line 174, in load
r = yaml.load(stream, Loader=get_jina_loader_with_runtime(runtime_args))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/andi/pdfGPT/venv_pdfGPT/lib/python3.11/site-packages/yaml/init.py", line 81, in load
return loader.get_single_data()
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/andi/pdfGPT/venv_pdfGPT/lib/python3.11/site-packages/yaml/constructor.py", line 51, in get_single_data
return self.construct_document(node)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/andi/pdfGPT/venv_pdfGPT/lib/python3.11/site-packages/yaml/constructor.py", line 55, in construct_document
data = self.construct_object(node)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/andi/pdfGPT/venv_pdfGPT/lib/python3.11/site-packages/yaml/constructor.py", line 100, in construct_object
data = constructor(self, node)
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/andi/pdfGPT/venv_pdfGPT/lib/python3.11/site-packages/jina/jaml/init.py", line 582, in _from_yaml
return get_parser(cls, version=data.get('version', None)).parse(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/andi/pdfGPT/venv_pdfGPT/lib/python3.11/site-packages/jina/jaml/parsers/gateway/legacy.py", line 56, in parse
obj = cls(
^^^^
File "/Users/andi/pdfGPT/venv_pdfGPT/lib/python3.11/site-packages/jina/serve/helper.py", line 72, in arg_wrapper
f = func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/andi/pdfGPT/venv_pdfGPT/lib/python3.11/site-packages/lcserve/backend/gateway.py", line 300, in init
self._register_modules()
File "/Users/andi/pdfGPT/venv_pdfGPT/lib/python3.11/site-packages/lcserve/backend/gateway.py", line 408, in _register_modules
self._register_mod(mod)
File "/Users/andi/pdfGPT/venv_pdfGPT/lib/python3.11/site-packages/lcserve/backend/gateway.py", line 412, in _register_mod
app_module = import_module(mod)
^^^^^^^^^^^^^^^^^^
File
"/opt/homebrew/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/init.py", line
126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "
File "
File "
File "
File "
File "
File "/Users/andi/pdfGPT/api.py", line 8, in
import fitz
File "/Users/andi/pdfGPT/venv_pdfGPT/lib/python3.11/site-packages/fitz/init.py", line 22, in
from fitz.fitz import *
File "/Users/andi/pdfGPT/venv_pdfGPT/lib/python3.11/site-packages/fitz/fitz.py", line 14, in
from . import _fitz
ImportError: dlopen(/Users/andi/pdfGPT/venv_pdfGPT/lib/python3.11/site-packages/fitz/_fitz.so, 0x0002): tried:
'/Users/andi/pdfGPT/venv_pdfGPT/lib/python3.11/site-packages/fitz/_fitz.so' (mach-o file, but is an incompatible architecture
(have 'x86_64', need 'arm64')),
'/System/Volumes/Preboot/Cryptexes/OS/Users/andi/pdfGPT/venv_pdfGPT/lib/python3.11/site-packages/fitz/_fitz.so' (no such file),
'/Users/andi/pdfGPT/venv_pdfGPT/lib/python3.11/site-packages/fitz/_fitz.so' (mach-o file, but is an incompatible architecture
(have 'x86_64', need 'arm64'))
ERROR Flow@20695 Flow is aborted due to ['gateway'] can not be started. [08/23/23 20:08:36]
Traceback (most recent call last):
File "/Users/andi/pdfGPT/venv_pdfGPT/bin/lc-serve", line 8, in
were you able to resolve this issue?
No I found that it is not solvable, there is a conflict between two dependencies on silicon Mac:
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. pydantic-core 2.6.3 requires typing-extensions!=4.7.0,>=4.6.0, but you have typing-extensions 4.5.0 which is incompatible. pydantic 2.3.0 requires typing-extensions>=4.6.1, but you have typing-extensions 4.5.0 which is incompatible.
and
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. tensorflow-macos 2.13.0 requires typing-extensions<4.6.0,>=3.6.6, but you have typing-extensions 4.7.1 which is incompatible.
This made me laugh at my helplessness here. Thanks for this. I'll try setting this up on a linux machine.