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

执行make backend 错误 #1557

Closed
huangbz2007 opened this issue Mar 25, 2024 · 4 comments
Closed

执行make backend 错误 #1557

huangbz2007 opened this issue Mar 25, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@huangbz2007
Copy link

1、make backend
2、错误
dlopen(/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/_cffi_backend.cpython-311-darwin.so, 0x0002): tried: '/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/_cffi_backend.cpython-311-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/_cffi_backend.cpython-311-darwin.so' (no such file), '/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/_cffi_backend.cpython-311-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))

Copy link

dosubot bot commented Mar 25, 2024

嘿,@huangbz2007,又见面了!希望一切都好。👽

这个错误是由于Python的CFFI库在一个不兼容的架构('arm64'和'x86_64')上运行导致的。你可以尝试以下步骤来解决这个问题:

  1. 更新基础镜像:你提供的Dockerfile使用的是Python 3.10 (FROM python:3.10-slim),但你遇到的问题似乎是与Python 3.11有关的。首先,确保你的Dockerfile使用的是正确的Python 3.11基础镜像。将Dockerfile的第一行更新为使用Python 3.11,如下所示:

    FROM python:3.11-slim

    这样可以确保你使用的是与你的上下文相符的Python版本。

  2. 指定平台:如果你在M1 Mac(或任何ARM64架构)上构建,并且目标是x86_64架构(或反之),你可以在构建过程中指定平台。使用Docker构建命令的--platform标志来指定目标架构。例如,如果你试图为x86_64架构构建,你可以使用:

    docker build --platform linux/amd64 -t your_image_name .

    或者,如果你的目标是arm64,使用:

    docker build --platform linux/arm64 -t your_image_name .

    这告诉Docker在构建过程中模拟目标架构。

  3. 多架构镜像:如果你打算在不同的架构上运行你的Docker镜像,考虑使用多架构镜像。这种方法更为高级,涉及到为Docker设置buildx,这样你就可以构建和推送多架构镜像。这样,基于主机架构,会自动使用正确的架构镜像。

通过更新到Python 3.11的基础镜像并在构建过程中指定目标平台,你应该能够解决你面临的架构兼容性问题。如果你在一个使用多种架构的开发环境中工作,设置多架构镜像可能是最稳健的解决方案。

参考资料:

关于make backend命令,它执行的具体步骤如下:

  1. 它使用poetry install --extras deploy安装后端依赖。
  2. 它杀掉任何使用端口7860的进程。
  3. 根据login变量,它运行后端,有或没有自动登录。如果login设置为1,它使用以下命令运行后端,没有自动登录:
    poetry run langflow run --backend-only --port 7860 --host 0.0.0.0 --no-open-browser --env-file .env
    
    否则,它使用以下命令运行后端,有自动登录:
    LANGFLOW_AUTO_LOGIN=True poetry run langflow run --backend-only --port 7860 --host 0.0.0.0 --no-open-browser --env-file .env
    

参考资料:

langflow仓库需要的确切Python版本是">=3.9,<3.12"。
参考资料:

Sources

About Dosu

This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

@dosubot dosubot bot added the bug Something isn't working label Mar 25, 2024
@dosubot dosubot bot added the stale label Jun 24, 2024
@anovazzi1
Copy link
Contributor

你好,
抱歉回复晚了。你试过使用新版本吗?错误还存在吗?

@dosubot dosubot bot removed the stale label Jul 1, 2024
@carlosrcoelho
Copy link
Contributor

Hi @huangbz2007

We hope you're doing well. Just a friendly reminder that if we do not hear back from you within the next 3 days, we will close this issue. If you need more time or further assistance, please let us know.


Thank you for your understanding!

@carlosrcoelho carlosrcoelho self-assigned this Jul 22, 2024
@carlosrcoelho
Copy link
Contributor

Thank you for your contribution! This issue will be closed. If you have any questions or encounter another problem, please open a new issue and we will be ready to assist you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants