0

我刚买了一台带有 M1 芯片的新 Mac,但我无法让我们的堆栈运行。

它是一个 django 项目,附加了一些依赖项。其中大多数是:

  • grpcio (1.43.0)
  • 谷歌云视觉==2.1.0
  • 谷歌地图==4.4.2
  • firebase-admin==5.2.0
  • google-api-core[grpc]==1.31.5 通过
    • 火力基地管理员
    • google-api-python 客户端
    • 谷歌云核心
    • 谷歌云火库
    • 谷歌云存储
    • 谷歌云视觉

使用 python 3.9.10 在新的 M1 上安装时,出现此错误

Traceback (most recent call last):
  File "/Users/tl/work/project/./manage.py", line 15, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/tl/work/project/venv/lib/python3.9/site-packages/django/core/management/__init__.py", line 425, in execute_from_command_line
    utility.execute()
  File "/Users/tl/work/project/venv/lib/python3.9/site-packages/django/core/management/__init__.py", line 401, in execute
    django.setup()
  File "/Users/tl/work/project/venv/lib/python3.9/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/Users/tl/work/project/venv/lib/python3.9/site-packages/django/apps/registry.py", line 122, in populate
    app_config.ready()
  File "/Users/tl/work/project/image_analysis/apps.py", line 8, in ready
    import image_analysis.signal_handlers
  File "/Users/tl/work/project/image_analysis/signal_handlers.py", line 6, in <module>
    from image_analysis.analyze import analyze_images
  File "/Users/tl/work/project/image_analysis/analyze.py", line 8, in <module>
    from google.cloud import vision
  File "/Users/tl/work/project/venv/lib/python3.9/site-packages/google/cloud/vision/__init__.py", line 18, in <module>
    from google.cloud.vision_v1.services.image_annotator.async_client import (
  File "/Users/tl/work/project/venv/lib/python3.9/site-packages/google/cloud/vision_v1/__init__.py", line 21, in <module>
    from .services.image_annotator import ImageAnnotatorClient as IacImageAnnotatorClient
  File "/Users/tl/work/project/venv/lib/python3.9/site-packages/google/cloud/vision_v1/services/image_annotator/__init__.py", line 18, in <module>
    from .client import ImageAnnotatorClient
  File "/Users/tl/work/project/venv/lib/python3.9/site-packages/google/cloud/vision_v1/services/image_annotator/client.py", line 27, in <module>
    from google.api_core import gapic_v1  # type: ignore
  File "/Users/tl/work/project/venv/lib/python3.9/site-packages/google/api_core/gapic_v1/__init__.py", line 18, in <module>
    from google.api_core.gapic_v1 import config
  File "/Users/tl/work/project/venv/lib/python3.9/site-packages/google/api_core/gapic_v1/config.py", line 23, in <module>
    import grpc
  File "/Users/tl/work/project/venv/lib/python3.9/site-packages/grpc/__init__.py", line 22, in <module>
    from grpc import _compression
  File "/Users/tl/work/project/venv/lib/python3.9/site-packages/grpc/_compression.py", line 15, in <module>
    from grpc._cython import cygrpc
ImportError: dlopen(/Users/tl/work/project/venv/lib/python3.9/site-packages/grpc/_cython/cygrpc.cpython-39-darwin.so, 0x0002): symbol not found in flat namespace '_EVP_DigestSignUpdate'

我尝试谷歌搜索这个问题无济于事。我正在使用 brew 来安装我的大部分东西,python 也是如此。

我还在 .zshrc 文件中设置了这些设置,以适应其他问题:

export CFLAGS="-I/opt/homebrew/opt/openssl/include"
export LDFLAGS="-L$(brew --prefix openssl)/lib -L$(brew --prefix zlib)/lib"
export CPPFLAGS="-I$(brew --prefix openssl)/include -I$(brew --prefix zlib)/include"
export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1
export GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1
4

0 回答 0