반응형
텐서플로 설치후 실행시 아래와 같은 에러가 발생 하였다.
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
실행환경
miniconda
PYTHONPATH: C:\Users\jskang\AppData\Local\Programs\Python\Python311\Lib\site-packages
PATH : C:\Users\jskang\miniconda3\envs\tf;C:\Users\jskang\miniconda3\envs\tf\Library\mingw-w64\bin;C:\Users\jskang\miniconda3\envs\tf\Library\usr\bin;C:\Users\jskang\miniconda3\envs\tf\Library\bin;C:\Users\jskang\miniconda3\envs\tf\Scripts;C:\Users\jskang\miniconda3\envs\tf\bin;C:\Users\jskang\miniconda3\condabin;C:\Program Files\NVIDIA\CUDNN\v9.0\bin;C:\Program Files\NVIDIA GPU Computing To...
전체 에러 내용
Traceback (most recent call last):
File "C:\Users\jskang\AppData\Local\Programs\Python\Python311\Lib\site-packages\numpy\core\__init__.py", line 23, in <module>
from . import multiarray
File "C:\Users\jskang\AppData\Local\Programs\Python\Python311\Lib\site-packages\numpy\core\multiarray.py", line 10, in <module>
from . import overrides
File "C:\Users\jskang\AppData\Local\Programs\Python\Python311\Lib\site-packages\numpy\core\overrides.py", line 6, in <module>
from numpy.core._multiarray_umath import (
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "e:\work\Tensorflow_딥러닝AI\src\test-tensorflow.py", line 17, in <module>
import tensorflow as tf
File "C:\Users\jskang\miniconda3\envs\tf\lib\site-packages\tensorflow\__init__.py", line 37, in <module>
from tensorflow.python.tools import module_util as _module_util
File "C:\Users\jskang\miniconda3\envs\tf\lib\site-packages\tensorflow\python\__init__.py", line 37, in <module>
from tensorflow.python.eager import context
File "C:\Users\jskang\miniconda3\envs\tf\lib\site-packages\tensorflow\python\eager\context.py", line 26, in <module>
import numpy as np
File "C:\Users\jskang\AppData\Local\Programs\Python\Python311\Lib\site-packages\numpy\__init__.py", line 141, in <module>
from . import core
File "C:\Users\jskang\AppData\Local\Programs\Python\Python311\Lib\site-packages\numpy\core\__init__.py", line 49, in <module>
raise ImportError(msg)
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
* The Python version is: Python3.9 from "C:\Users\jskang\miniconda3\envs\tf\python.exe"
* The NumPy version is: "1.24.3"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: No module named 'numpy.core._multiarray_umath'
원인
원인은 완전히는 모르겠는데 이것저것 설치하면서 원래 파이썬3.11 경로쪽의 numpy를 찾고 있는거 같다.
해결방법
해결방법은 의외로 간단하다.
numpy과 setuptools 를 지우고 다시 설치하면 해결 된다.
(setuptools 는 python 라이브러리 관리하는데 사용되는 라이브러리)
pip uninstall -y numpy
pip uninstall -y setuptools
pip install setuptools
pip install numpy
관련된 텐서플로 설치방법
2024.03.19 - [ML] - Windows11 Tensorflow2, NVIDIA CUDA 사용하기 (feat. wsl)
Windows11 Tensorflow2, NVIDIA CUDA 사용하기 (feat. wsl)
윈도우11 환경에서 Tensorflow2.x 와 GPU 를 사용하기 위해 NVIDIA CUDA를 사용하는 환경을 설정하는 방법을 알아보겠습니다. Tensorflow 문서를 보면 리눅스, 맥 OS, 윈도우 네이티브, 윈도우 WSL2 4가지 종류
dtbb.tistory.com
반응형
'Python' 카테고리의 다른 글
미니콘다(miniconda) 가상환경 list, 생성, 삭제, 활성화, 비활성화 방법 (0) | 2024.03.21 |
---|---|
miniconda 가상환경 경로 바꾸기 (0) | 2024.03.20 |
윈도우 VSCode에서 파이썬을 리눅스 도커환경으로 실행하기 [Windows + VSCode + Python + Docker] (2) | 2024.02.20 |
[VSCode] Unknown word. cSpell 문제 해결방법 (2) | 2023.11.14 |
[langchain + openai 에러] AttributeError: module 'openai' has no attribute 'error' (3) | 2023.11.13 |