pandas icon indicating copy to clipboard operation
pandas copied to clipboard

Mac (with M2 chip) install of pandas with Poetry

Open erlebach opened this issue 1 year ago • 0 comments

Installation check

Platform

macOS-14.4.1-arm64-arm-64bit

Installation Method

Other

pandas Version

2.2.2

Python Version

3.12.1 (which python)

Installation Logs

Installation with poetry. Pyproject.toml:

[tool.poetry]
name = "copa-data-filtering"
version = "1.0.1"
description = "Use LLM to improve plane maintenance at Copa"
authors = ["Anand Kamble and Gordon Erlebacher"]
readme = "README.md"

[tool.poetry.dependencies]
python = ">=3.10, < 3.13"

Poetry add pandas:

 poetry add pandas
Using version ^2.2.2 for pandas

Updating dependencies
Resolving dependencies... (0.3s)

Package operations: 6 installs, 0 updates, 0 removals

  - Installing six (1.16.0)
  - Installing numpy (1.26.4)
  - Installing python-dateutil (2.9.0.post0)
  - Installing pytz (2024.1)
  - Installing tzdata (2024.1)
  - Installing pandas (2.2.2)

Writing lock file

Execute 'poetry shell':

 poetry shell
Spawning shell within /Users/erlebach/src/2024/copa_data-filtering/.venv
inside .zshrc
(base) ➜  copa_data-filtering emulate bash -c '. /Users/erlebach/src/2024/copa_data-filtering/.venv/bin/activate'

I now run python and import pandas:

 python
Python 3.10.10 (main, Mar 21 2023, 13:41:05) [Clang 14.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/erlebach/src/2024/copa_data-filtering/.venv/lib/python3.10/site-packages/pandas/__init__.py", line 49, in <module>
    from pandas.core.api import (
  File "/Users/erlebach/src/2024/copa_data-filtering/.venv/lib/python3.10/site-packages/pandas/core/api.py", line 1, in <module>
    from pandas._libs import (
  File "/Users/erlebach/src/2024/copa_data-filtering/.venv/lib/python3.10/site-packages/pandas/_libs/__init__.py", line 16, in <module>
    import pandas._libs.pandas_parser  # isort: skip # type: ignore[reportUnusedImport]
ImportError: dlopen(/Users/erlebach/src/2024/copa_data-filtering/.venv/lib/python3.10/site-packages/pandas/_libs/pandas_parser.cpython-310-darwin.so, 0x0002): tried: '/Users/erlebach/src/2024/copa_data-filtering/.venv/lib/python3.10/site-packages/pandas/_libs/pandas_parser.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/erlebach/src/2024/copa_data-filtering/.venv/lib/python3.10/site-packages/pandas/_libs/pandas_parser.cpython-310-darwin.so' (no such file), '/Users/erlebach/src/2024/copa_data-filtering/.venv/lib/python3.10/site-packages/pandas/_libs/pandas_parser.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64'))

Note the incompatible binary. This has never happened before. The ARM architecture has been around for quite a while already and I assume that there are versions of pandas compatible with ARM?

Any advice is appreciated.

erlebach avatar May 09 '24 14:05 erlebach