You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

M1 Max芯片Mac中Micromamba虚拟环境下PyTorch导入失败问题求助

M1 Max芯片Mac中Micromamba虚拟环境下PyTorch导入失败问题求助

大家好,我在M1 Max芯片的Mac上遇到了PyTorch导入失败的问题,想请各位帮忙排查下:

直到最近(圣诞节前肯定还能正常使用,但记不清上次成功导入的具体时间),torch在我的Mac上一直运行正常,但今天导入时直接报错了。错误信息如下:

In [1]: import torch
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[1], line 1
----> 1 import torch

File ~/micromamba/envs/Jan03/lib/python3.13/site-packages/torch/__init__.py:367
    365     if USE_GLOBAL_DEPS:
    366         _load_global_deps()
--> 367     from torch._C import *  # noqa: F403
    370 class SymInt:
    371     """
    372     Like an int (including magic methods), but redirects all operations on the
    373     wrapped node. This is used in particular to symbolically record operations
    374     in the symbolic shape workflow.
    375     """

ImportError: dlopen(/Users/sammcd/micromamba/envs/Jan03/lib/python3.13/site-packages/torch/_C.cpython-313-darwin.so, 0x0002): Symbol not found: __ZN4absl12lts_2024072212log_internal10LogMessagelsIiLi0EEERS2_RKT_
  Referenced from: <7DD6F527-7A4A-3649-87B6-D68B25F8B594> /Users/sammcd/micromamba/envs/Jan03/lib/libprotobuf.28.2.0.dylib
  Expected in:     <D623F952-8116-35EC-859D-F7F8D5DD7699> /Users/sammcd/micromamba/envs/Jan03/lib/libabsl_log_internal_message.2407.0.0.dylib

补充几个环境细节:

  • 出问题的是micromamba创建的全新虚拟环境,配置为Python 3.13 + PyTorch 2.5.1
  • 我有个Python 3.9 + PyTorch 2.4的虚拟环境是完全正常的
  • 同时,Python 3.12 + PyTorch 2.5的虚拟环境也出现了同样的导入失败问题

备注:内容来源于stack exchange,提问作者user1451632

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.14 12:33:01