0

I recently tried to downgrade pandas to version 1.2.3 using pip, but clearly messed something up. Sadly I was not in my environment so it is messed up everywhere. How do I get correct for this?

I have homebrew too.

Python 3.9.13 | packaged by conda-forge | (main, May 27 2022, 17:00:33) 
[Clang 13.0.1 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas
Traceback (most recent call last):
  File "__init__.pxd", line 942, in numpy.import_array
RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xf

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/jremmert/miniforge3/lib/python3.9/site-packages/pandas/__init__.py", line 29, in <module>
    from pandas._libs import hashtable as _hashtable, lib as _lib, tslib as _tslib
  File "/Users/jremmert/miniforge3/lib/python3.9/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
  File "pandas/_libs/hashtable.pyx", line 1, in init pandas._libs.hashtable
  File "pandas/_libs/missing.pyx", line 1, in init pandas._libs.missing
  File "/Users/jremmert/miniforge3/lib/python3.9/site-packages/pandas/_libs/tslibs/__init__.py", line 30, in <module>
    from .conversion import OutOfBoundsTimedelta, localize_pydatetime
  File "pandas/_libs/tslibs/conversion.pyx", line 1, in init pandas._libs.tslibs.conversion
  File "pandas/_libs/tslibs/nattype.pyx", line 30, in init pandas._libs.tslibs.nattype
  File "__init__.pxd", line 944, in numpy.import_array
ImportError: numpy.core.multiarray failed to import

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/jremmert/miniforge3/lib/python3.9/site-packages/pandas/__init__.py", line 33, in <module>
    raise ImportError(
ImportError: C extension: numpy.core.multiarray failed to import not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --force' to build the C extensions first.
Jack Armstrong
  • 1,182
  • 4
  • 26
  • 59
  • That was a bad idea. This type of change is "likely" to require reinstalling. Use environment when available. – Trenton McKinney Jul 29 '22 at 00:40
  • https://stackoverflow.com/q/30761152/7758804 - reinstall – Trenton McKinney Jul 29 '22 at 00:53
  • 1
    Turns out I was in an environment. I created an environment to download and set up tensorflow. I then created another environment within that one. Everything looks okay now. Thank you. I would post your comment as an answer. – Jack Armstrong Jul 29 '22 at 01:07

0 Answers0