以下のように、pandasのインポートに失敗してしまいます。
pandasはpipでインストールしました。
pandasのバージョンは1.3.4です。
zsh
1[xxxxx@MacBookAir ~]% python 2Python 3.9.7 (default, Oct 12 2021, 22:38:23) 3[Clang 13.0.0 (clang-1300.0.29.3)] on darwin 4Type "help", "copyright", "credits" or "license" for more information. 5>>> import pandas 6Traceback (most recent call last): 7 File "<stdin>", line 1, in <module> 8 File "/opt/homebrew/lib/python3.9/site-packages/pandas/__init__.py", line 22, in <module> 9 from pandas.compat import ( 10 File "/opt/homebrew/lib/python3.9/site-packages/pandas/compat/__init__.py", line 15, in <module> 11 from pandas.compat.numpy import ( 12 File "/opt/homebrew/lib/python3.9/site-packages/pandas/compat/numpy/__init__.py", line 7, in <module> 13 from pandas.util.version import Version 14 File "/opt/homebrew/lib/python3.9/site-packages/pandas/util/__init__.py", line 1, in <module> 15 from pandas.util._decorators import ( # noqa 16 File "/opt/homebrew/lib/python3.9/site-packages/pandas/util/_decorators.py", line 14, in <module> 17 from pandas._libs.properties import cache_readonly # noqa 18 File "/opt/homebrew/lib/python3.9/site-packages/pandas/_libs/__init__.py", line 13, in <module> 19 from pandas._libs.interval import Interval 20ImportError: dlopen(/opt/homebrew/lib/python3.9/site-packages/pandas/_libs/interval.cpython-39-darwin.so, 2): no suitable image found. Did find: 21 /opt/homebrew/lib/python3.9/site-packages/pandas/_libs/interval.cpython-39-darwin.so: mach-o, but wrong architecture 22 /opt/homebrew/lib/python3.9/site-packages/pandas/_libs/interval.cpython-39-darwin.so: mach-o, but wrong architecture 23>>>
環境情報は以下のとおりです。
macOS Big Sur バージョン 11.2.2 MacBook Air (M1, 2020) Python 3.9.7 pip 21.3.1 from /opt/homebrew/lib/python3.9/site-packages/pip (python 3.9) Homebrew 3.3.5
わかるかたいましたら、教えていただけると幸いです。
回答2件
あなたの回答
tips
プレビュー