I'm encountering a reproducible issue when installing specific versions of pandas and numpy in Colab.
My project depends on:
- pandas==2.2.3
- numpy==1.26.4.
These versions work perfectly in my local environment. However, in this Colab notebook, attempting to install and import them immediately results in an error when running import pandas.
What’s unusual is that if I restart the runtime and run all cells again, the error disappears and everything works as expected.
I'm running this in Chrome.
Here is the full stack trace for reference:
ValueError Traceback (most recent call last)
[<ipython-input-2-38d4b0363d82>](https://localhost:8080/#) in <cell line: 0>()
----> 1 import pandas
6 frames
[/usr/local/lib/python3.11/dist-packages/pandas/__init__.py](https://localhost:8080/#) in <module>
35 ) from _err
36
---> 37 from pandas._config import (
38 get_option,
39 set_option,
[/usr/local/lib/python3.11/dist-packages/pandas/_config/__init__.py](https://localhost:8080/#) in <module>
18 "warn_copy_on_write",
19 ]
---> 20 from pandas._config import config
21 from pandas._config import dates # pyright: ignore[reportUnusedImport] # noqa: F401
22 from pandas._config.config import (
[/usr/local/lib/python3.11/dist-packages/pandas/_config/config.py](https://localhost:8080/#) in <module>
66 import warnings
67
---> 68 from pandas._typing import (
69 F,
70 T,
[/usr/local/lib/python3.11/dist-packages/pandas/_typing.py](https://localhost:8080/#) in <module>
196 int,
197 np.ndarray,
--> 198 np.random.Generator,
199 np.random.BitGenerator,
200 np.random.RandomState,
[/usr/local/lib/python3.11/dist-packages/numpy/__init__.py](https://localhost:8080/#) in __getattr__(attr)
335
336 def __dir__():
--> 337 public_symbols = globals().keys() | {'testing'}
338 public_symbols -= {
339 "core", "matrixlib",
[/usr/local/lib/python3.11/dist-packages/numpy/random/__init__.py](https://localhost:8080/#) in <module>
178
179 # add these for module-freeze analysis (like PyInstaller)
--> 180 from . import _pickle
181 from . import _common
182 from . import _bounded_integers
[/usr/local/lib/python3.11/dist-packages/numpy/random/_pickle.py](https://localhost:8080/#) in <module>
----> 1 from .mtrand import RandomState
2 from ._philox import Philox
3 from ._pcg64 import PCG64, PCG64DXSM
4 from ._sfc64 import SFC64
5
numpy/random/mtrand.pyx in init numpy.random.mtrand()
ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject```
I'm encountering a reproducible issue when installing specific versions of pandas and numpy in Colab.
My project depends on:
These versions work perfectly in my local environment. However, in this Colab notebook, attempting to install and import them immediately results in an error when running
import pandas.What’s unusual is that if I restart the runtime and run all cells again, the error disappears and everything works as expected.
I'm running this in Chrome.
Here is the full stack trace for reference: