ICT 드림업 - 무물 매니저/개발

콘다 numpy 2.x버전으로 커널 실행 안되는 문제

kangchaewon 2025. 5. 22. 14:16
An error occurred while starting the kernel

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.2.6 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

Traceback (most recent call last): File "/opt/anaconda3/lib/python3.12/runpy.py", line 198, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/opt/anaconda3/lib/python3.12/runpy.py", line 88, in _run_code
exec(code, run_globals)
File "/opt/anaconda3/lib/python3.12/site‑packages/spyder_kernels/console/__main__.py", line 24, in
start.main()
File "/opt/anaconda3/lib/python3.12/site‑packages/spyder_kernels/console/start.py", line 151, in main
import_spydercustomize()
File "/opt/anaconda3/lib/python3.12/site‑packages/spyder_kernels/console/start.py", line 41, in import_spydercustomize
import spydercustomize # noqa
File "/opt/anaconda3/lib/python3.12/site‑packages/spyder_kernels/customize/spydercustomize.py", line 167, in
import pandas as pd
File "/opt/anaconda3/lib/python3.12/site‑packages/pandas/__init__.py", line 26, in
from pandas.compat import (
File "/opt/anaconda3/lib/python3.12/site‑packages/pandas/compat/__init__.py", line 27, in
from pandas.compat.pyarrow import (
File "/opt/anaconda3/lib/python3.12/site‑packages/pandas/compat/pyarrow.py", line 8, in
import pyarrow as pa
File "/opt/anaconda3/lib/python3.12/site‑packages/pyarrow/__init__.py", line 65, in
import pyarrow.lib as _lib
Traceback (most recent call last):
File "/opt/anaconda3/lib/python3.12/site‑packages/numpy/core/_multiarray_umath.py", line 44, in __getattr__
raise ImportError(msg)
ImportError:
A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.2.6 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

시도1

numpy자체를 버전을 변경하려고 했지만 관련된 다른 설치파일들도 삭제가 된다며 실패했다.

conda 핵심 구성 요소 charset-normalizer, tqdm, packaging, setuptools도 같이 삭제되려고 하기 때문.

$ conda install numpy=1.26.4

RemoveError: 'charset-normalizer' is a dependency of conda and cannot be removed from
conda's operating environment.
RemoveError: 'tqdm' is a dependency of conda and cannot be removed from
conda's operating environment.
RemoveError: 'packaging' is a dependency of conda and cannot be removed from
conda's operating environment.
RemoveError: 'setuptools' is a dependency of conda and cannot be removed from
conda's operating environment.

 

시도2

1. spyder만 지우고

$ conda remove spyder spyder-kernels

 

2. numpy버전 다시 설정

$ conda install numpy=1.26.4

 

3. spyder 재설치

$ conda install spyder

 

-> 성공! 다시 spyder가 돌아간다