PS1607 / mbox-to-json

A small package that converts MBOX files to JSON(or CSV). Also includes functionality to extract attachments.
https://pypi.org/project/mbox-to-json/
MIT License
23 stars 3 forks source link

ValueError: numpy.dtype size changed, may indicate binary incompatibility #14

Open vwkd opened 2 weeks ago

vwkd commented 2 weeks ago

When installing it in a virtual environment with Python 3.12.5 on macOS Sonoma 14.6.1, running it throws an error ValueError: numpy.dtype size changed, may indicate binary incompatibility.

> python3 -m venv env
> source ./env/bin/activate
> pip install mbox-to-json
Collecting mbox-to-json
  Downloading mbox_to_json-1.0.3-py3-none-any.whl.metadata (6.6 kB)
Collecting alive-progress==3.0.1 (from mbox-to-json)
  Downloading alive_progress-3.0.1-py3-none-any.whl.metadata (60 kB)
Collecting pandas==1.4.2 (from mbox-to-json)
  Downloading pandas-1.4.2.tar.gz (4.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.9/4.9 MB 7.0 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting setuptools==59.4.0 (from mbox-to-json)
  Downloading setuptools-59.4.0-py3-none-any.whl.metadata (5.0 kB)
Collecting about-time==4.2.1 (from alive-progress==3.0.1->mbox-to-json)
  Downloading about_time-4.2.1-py3-none-any.whl.metadata (13 kB)
Collecting grapheme==0.6.0 (from alive-progress==3.0.1->mbox-to-json)
  Downloading grapheme-0.6.0.tar.gz (207 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting python-dateutil>=2.8.1 (from pandas==1.4.2->mbox-to-json)
  Using cached python_dateutil-2.9.0.post0-py2.py3-none-any.whl.metadata (8.4 kB)
Collecting pytz>=2020.1 (from pandas==1.4.2->mbox-to-json)
  Downloading pytz-2024.2-py2.py3-none-any.whl.metadata (22 kB)
Collecting numpy>=1.21.0 (from pandas==1.4.2->mbox-to-json)
  Downloading numpy-2.1.1-cp312-cp312-macosx_14_0_arm64.whl.metadata (60 kB)
Collecting six>=1.5 (from python-dateutil>=2.8.1->pandas==1.4.2->mbox-to-json)
  Using cached six-1.16.0-py2.py3-none-any.whl.metadata (1.8 kB)
Downloading mbox_to_json-1.0.3-py3-none-any.whl (8.1 kB)
Downloading alive_progress-3.0.1-py3-none-any.whl (72 kB)
Downloading setuptools-59.4.0-py3-none-any.whl (952 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 952.3/952.3 kB 22.9 MB/s eta 0:00:00
Downloading about_time-4.2.1-py3-none-any.whl (13 kB)
Downloading numpy-2.1.1-cp312-cp312-macosx_14_0_arm64.whl (5.1 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.1/5.1 MB 5.9 MB/s eta 0:00:00
Using cached python_dateutil-2.9.0.post0-py2.py3-none-any.whl (229 kB)
Downloading pytz-2024.2-py2.py3-none-any.whl (508 kB)
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Building wheels for collected packages: pandas, grapheme
  Building wheel for pandas (pyproject.toml) ... done
  Created wheel for pandas: filename=pandas-1.4.2-cp312-cp312-macosx_14_0_arm64.whl size=9940328 sha256=aa0b32b30bdf45ec071662cdae5dd619f2719001547a78f55fcedc59998e32dd
  Stored in directory: /Users/johndoe/Library/Caches/pip/wheels/43/86/9b/7f4aeae096cc07bcae037bde282b45d9a4c0ffb11053ace14a
  Building wheel for grapheme (pyproject.toml) ... done
  Created wheel for grapheme: filename=grapheme-0.6.0-py3-none-any.whl size=210078 sha256=4d89ad088dc0a9b8c682fe0b896bf00d8ce04156eead346e3a3181c78cddbb06
  Stored in directory: /Users/johndoe/Library/Caches/pip/wheels/5b/aa/3b/d94434910f5e19ac7f8aa6523d74a46fe06bfcbc7e4b26caf6
Successfully built pandas grapheme
Installing collected packages: pytz, grapheme, six, setuptools, numpy, about-time, python-dateutil, alive-progress, pandas, mbox-to-json
Successfully installed about-time-4.2.1 alive-progress-3.0.1 grapheme-0.6.0 mbox-to-json-1.0.3 numpy-2.1.1 pandas-1.4.2 python-dateutil-2.9.0.post0 pytz-2024.2 setuptools-59.4.0 six-1.16.0
> mbox-to-json -h
Traceback (most recent call last):
  File "/Users/johndoe/foobar/env/bin/mbox-to-json", line 5, in <module>
    from src.main import main
  File "/Users/johndoe/foobar/env/lib/python3.12/site-packages/src/main.py", line 2, in <module>
    import pandas as pd
  File "/Users/johndoe/foobar/env/lib/python3.12/site-packages/pandas/__init__.py", line 22, in <module>
    from pandas.compat import is_numpy_dev as _is_numpy_dev
  File "/Users/johndoe/foobar/env/lib/python3.12/site-packages/pandas/compat/__init__.py", line 15, in <module>
    from pandas.compat.numpy import (
  File "/Users/johndoe/foobar/env/lib/python3.12/site-packages/pandas/compat/numpy/__init__.py", line 4, in <module>
    from pandas.util.version import Version
  File "/Users/johndoe/foobar/env/lib/python3.12/site-packages/pandas/util/__init__.py", line 1, in <module>
    from pandas.util._decorators import (  # noqa:F401
  File "/Users/johndoe/foobar/env/lib/python3.12/site-packages/pandas/util/_decorators.py", line 14, in <module>
    from pandas._libs.properties import cache_readonly  # noqa:F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/johndoe/foobar/env/lib/python3.12/site-packages/pandas/_libs/__init__.py", line 13, in <module>
    from pandas._libs.interval import Interval
  File "pandas/_libs/interval.pyx", line 1, in init pandas._libs.interval
ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject
vwkd commented 2 weeks ago

Was able to temporarily work around this by downgrading numpy to 1.26.4.

> pip uninstall numpy
> pip install --no-cache-dir --force-reinstall mbox-to-json numpy==1.26.4