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

[Bug]: M1 Mac 安装报错 #771

Closed
phoeniiix1203 opened this issue May 20, 2023 · 2 comments
Closed

[Bug]: M1 Mac 安装报错 #771

phoeniiix1203 opened this issue May 20, 2023 · 2 comments

Comments

@phoeniiix1203
Copy link

Installation Method | 安装方法与平台

Anaconda (I used latest requirements.txt and python>=3.8)

Describe the bug | 简述

按照说明操作,执行 python main.py 报错,最后用docker才安装成功
ImportError: dlopen(/Users/phoenix/.local/lib/python3.11/site-packages/orjson/orjson.cpython-311-darwin.so, 0x0002): tried: '/Users/phoenix/.local/lib/python3.11/site-packages/orjson/orjson.cpython-311-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/phoenix/.local/lib/python3.11/site-packages/orjson/orjson.cpython-311-darwin.so' (no such file), '/Users/phoenix/.local/lib/python3.11/site-packages/orjson/orjson.cpython-311-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))

Screen Shot | 有帮助的截图

python main.py
Traceback (most recent call last):
File "/Users/phoenix/gpt_academic/main.py", line 210, in
main()
File "/Users/phoenix/gpt_academic/main.py", line 4, in main
import gradio as gr
File "/Users/phoenix/.local/lib/python3.11/site-packages/gradio/init.py", line 3, in
import gradio.components as components
File "/Users/phoenix/.local/lib/python3.11/site-packages/gradio/components.py", line 56, in
from gradio.blocks import Block, BlockContext
File "/Users/phoenix/.local/lib/python3.11/site-packages/gradio/blocks.py", line 25, in
from gradio import (
File "/Users/phoenix/.local/lib/python3.11/site-packages/gradio/networking.py", line 17, in
from gradio.routes import App
File "/Users/phoenix/.local/lib/python3.11/site-packages/gradio/routes.py", line 24, in
import orjson
File "/Users/phoenix/.local/lib/python3.11/site-packages/orjson/init.py", line 3, in
from .orjson import *
ImportError: dlopen(/Users/phoenix/.local/lib/python3.11/site-packages/orjson/orjson.cpython-311-darwin.so, 0x0002): tried: '/Users/phoenix/.local/lib/python3.11/site-packages/orjson/orjson.cpython-311-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/phoenix/.local/lib/python3.11/site-packages/orjson/orjson.cpython-311-darwin.so' (no such file), '/Users/phoenix/.local/lib/python3.11/site-packages/orjson/orjson.cpython-311-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))

Terminal Traceback & Material to Help Reproduce Bugs | 终端traceback(如有) + 帮助我们复现的测试材料样本(如有)

(gptac_venv) ➜ gpt_academic git:(master) ✗ python main.py
Traceback (most recent call last):
File "/Users/phoenix/gpt_academic/main.py", line 210, in
main()
File "/Users/phoenix/gpt_academic/main.py", line 4, in main
import gradio as gr
File "/Users/phoenix/.local/lib/python3.11/site-packages/gradio/init.py", line 3, in
import gradio.components as components
File "/Users/phoenix/.local/lib/python3.11/site-packages/gradio/components.py", line 56, in
from gradio.blocks import Block, BlockContext
File "/Users/phoenix/.local/lib/python3.11/site-packages/gradio/blocks.py", line 25, in
from gradio import (
File "/Users/phoenix/.local/lib/python3.11/site-packages/gradio/networking.py", line 17, in
from gradio.routes import App
File "/Users/phoenix/.local/lib/python3.11/site-packages/gradio/routes.py", line 24, in
import orjson
File "/Users/phoenix/.local/lib/python3.11/site-packages/orjson/init.py", line 3, in
from .orjson import *
ImportError: dlopen(/Users/phoenix/.local/lib/python3.11/site-packages/orjson/orjson.cpython-311-darwin.so, 0x0002): tried: '/Users/phoenix/.local/lib/python3.11/site-packages/orjson/orjson.cpython-311-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/phoenix/.local/lib/python3.11/site-packages/orjson/orjson.cpython-311-darwin.so' (no such file), '/Users/phoenix/.local/lib/python3.11/site-packages/orjson/orjson.cpython-311-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))

@binary-husky
Copy link
Owner

Significant-Gravitas/AutoGPT#3455

CPU的架构特殊

@qinmianer
Copy link

qinmianer commented May 23, 2023

M1 Mac,conda环境 (使用的是最新的requirements.txt, Python 3.11.3)
按照说明操作,运行python main.py,遇到了类似的问题,但是是tokenizer出错了
python main.py
Traceback (most recent call last):
File "/Users/tanjx/software/miniforge3/envs/gpt/lib/python3.11/site-packages/transformers/utils/import_utils.py", line 1172, in _get_module
return importlib.import_module("." + module_name, self.name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/tanjx/software/miniforge3/envs/gpt/lib/python3.11/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1206, in _gcd_import
File "", line 1178, in _find_and_load
File "", line 1128, in _find_and_load_unlocked
File "", line 241, in _call_with_frames_removed
File "", line 1206, in _gcd_import
File "", line 1178, in _find_and_load
File "", line 1149, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/Users/tanjx/software/miniforge3/envs/gpt/lib/python3.11/site-packages/transformers/models/init.py", line 15, in
from . import (
File "/Users/tanjx/software/miniforge3/envs/gpt/lib/python3.11/site-packages/transformers/models/mt5/init.py", line 36, in
from ..t5.tokenization_t5_fast import T5TokenizerFast
File "/Users/tanjx/software/miniforge3/envs/gpt/lib/python3.11/site-packages/transformers/models/t5/tokenization_t5_fast.py", line 24, in
from ...tokenization_utils_fast import PreTrainedTokenizerFast
File "/Users/tanjx/software/miniforge3/envs/gpt/lib/python3.11/site-packages/transformers/tokenization_utils_fast.py", line 25, in
import tokenizers.pre_tokenizers as pre_tokenizers_fast
File "/Users/tanjx/software/miniforge3/envs/gpt/lib/python3.11/site-packages/tokenizers/init.py", line 80, in
from .tokenizers import (
ImportError: dlopen(/Users/tanjx/software/miniforge3/envs/gpt/lib/python3.11/site-packages/tokenizers/tokenizers.cpython-311-darwin.so, 2): no suitable image found. Did find:
/Users/tanjx/software/miniforge3/envs/gpt/lib/python3.11/site-packages/tokenizers/tokenizers.cpython-311-darwin.so: mach-o, but wrong architecture
/Users/tanjx/software/miniforge3/envs/gpt/lib/python3.11/site-packages/tokenizers/tokenizers.cpython-311-darwin.so: mach-o, but wrong architecture

tokenizers版本信息如下:
pip show tokenizers
Name: tokenizers
Version: 0.13.3
Summary: Fast and Customizable Tokenizers
Home-page: https://github.com/huggingface/tokenizers
Author: Anthony MOI
Author-email: [email protected]
License: Apache License 2.0
Location: /Users/tanjx/software/miniforge3/envs/gpt/lib/python3.11/site-packages
Requires:
Required-by: transformers

问题已解决,参考:huggingface/tokenizers#712

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

3 participants