numpy
를 가져 오는 방법이 있습니까
설치하지 않고?
.exe
에 내장 된 일반 애플리케이션이 있습니다
PyInstaller와 함께. 이 응용 프로그램에는 플러그인 스크립트가있어 Python 스크립트를 통해 확장 할 수 있습니다. 플러그인 가져 오기 시스템은 기본 모듈 (론
.py
)에 적합합니다.
파일, 클래스, 함수 및 간단한 패키지). 내부적으로 플러그인 디렉토리를 가져온 다음
__import__
를 사용하여 가져옵니다.
또는
importlib.import_module
.
이 응용 프로그램은 실행 파일의 전체 크기를 줄이기 위해 최소한의 종속성으로 빌드됩니다. 또한, 미래의 플러그인이모든 것을 포함하기 위해 어떤 의존성이 필요할지 또는 실제적인지 알 수 없습니다. 그러나 일부 플러그인에는 필연적으로 종속성이 필요합니다.
numpy
이 클래스의 문제를 해결하기위한 좋은 테스트 사례입니다.
"
numpy
를 가져 오는 방법이 있습니까
설치하지 않고? "
"아니요, 단순하거나, 감사하거나, 실용적인 의미가 아닙니다."
컴파일 및 포장
numpy
수동으로. 그러나 그것은 간단하지 않습니다.
내가 시도한 것이 있습니다.
휠 파일은 실제로 디렉토리 일뿐입니다.
sys.path
에 추가 가능
내용을 가져 왔습니다.
import sys
sys.path.append(r"C:\path\to\numpy-1.16.3+mkl-cp36-cp36m-win_amd64.whl")
import numpy as np
휠 파일을 읽지 만 가져 오기에서 오류가 발생합니다.
*** ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
Here is how to proceed:
- If you're working with a numpy git repository, try `git clean -xdf`
(removes all files not under version control) and rebuild numpy.
- If you are simply trying to use the numpy version that you have installed:
your installation is broken - please reinstall numpy.
- If you have already reinstalled and that did not fix the problem, then:
1. Check that you are using the Python you expect (you're using c:\projects\zip_test\venv\Scripts\python.exe),
and that you have no directories in your PATH or PYTHONPATH that can
interfere with the Python and numpy versions you're trying to use.
2. If (1) looks fine, you can open a new issue at
https://github.com/numpy/numpy/issues. Please include details on:
- how you installed Python
- how you installed numpy
- your operating system
- whether or not you have multiple versions of Python installed
- if you built from source, your compiler versions and ideally a build log
Note: this error has many possible causes, so please don't comment on
an existing issue about this - open a new one instead.
Original error was: No module named 'numpy.core._multiarray_umath'
퍼즐 링 부분은 휠 파일에
.pyd
가 포함되어 있다는 것입니다
_multiarray_umath
를 위해
.
C:\projects\zip_test\plugins\New folder\numpy\core>dir
Volume in drive C is OS
Volume Serial Number is FE3D-6596
Directory of C:\projects\zip_test\plugins\New folder\numpy\core
07/25/2019 02:37 PM <DIR> .
07/25/2019 02:37 PM <DIR> ..
....
04/22/2019 02:55 AM 101,376 _multiarray_tests.cp36-win_amd64.pyd
04/22/2019 02:55 AM 2,494,976 _multiarray_umath.cp36-win_amd64.pyd
....
74 File(s) 583,173,551 bytes
5 Dir(s) 309,925,851,136 bytes free
이것은 경로 문제처럼 느껴집니다. 그러나
core/
의 직접 경로 추가
sys.path
로
같은 오류가 발생합니다.
sys.path.append(r"C:\projects\zip_test\plugins\numpy-1.16.3+mkl-cp36-cp36m-win_amd64.whl\numpy\core")
거래는 무엇입니까? 왜 파이썬에서
numpy.core._multiarray_umath
를 찾을 수 없습니까?
?
응답자에 대한 답변 :
- 휠 파일은 Christoph Gohlke에서 얻었습니다.
- 내 운영 체제는 Windows 10 Pro 64 비트입니다.
-
Python 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 24 2018, 00:16:47) [MSC v.1916 64 bit (AMD64)] on win32
를 실행 중입니다 (Python Foundation Build3.6.8150.0
를 통해 설치됨 )venv
에서 . "시스템"파이썬이PATH
에 없습니다 . -
numpy-1.16.3+mkl-cp36-cp36m-win_amd64.whl
를 설치할 수 있습니다pip
를 통한 파일 그리고import numpy as np
잘 작동합니다. 그런 다음numpy
를 제거하십시오.pip uninstall -y numpy
를 통해 .
dumpbin /dependents _multiarray_umath.cp36-win_amd64.pyd
를 실행
다음을 생성합니다 :
Microsoft (R) COFF/PE Dumper Version 14.22.27905.0
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file _multiarray_umath.cp36-win_amd64.pyd
File Type: DLL
Image has the following dependencies:
mkl_rt.dll
python36.dll
KERNEL32.dll
VCRUNTIME140.dll
api-ms-win-crt-heap-l1-1-0.dll
api-ms-win-crt-stdio-l1-1-0.dll
api-ms-win-crt-math-l1-1-0.dll
api-ms-win-crt-runtime-l1-1-0.dll
api-ms-win-crt-string-l1-1-0.dll
api-ms-win-crt-convert-l1-1-0.dll
api-ms-win-crt-time-l1-1-0.dll
api-ms-win-crt-utility-l1-1-0.dll
api-ms-win-crt-locale-l1-1-0.dll
Summary
77000 .data
1000 .gfids
1C000 .pdata
30000 .rdata
3000 .reloc
1000 .rsrc
1BD000 .text
종속성 중에서
mkl_rt.dll
를 찾을 수 있습니다
python36.dll
및
VCRUNTIME140.dll
어느
.whl
에서
또는
venv
. 두 가지 버전의
KERNEL32.dll
가 있습니다.
, 하나는 x86, 하나는 x64입니다. 이 중 하나는
C:\Windows\System32
에 있습니다.
.
api-ms-win-crt-*.dll
에 대해 찾을 수있는 유일한 정보
MSDN "Windows의 Universal C 런타임 업데이트"내의
The Windows 10 Universal CRT is a Windows operating system component that enables CRT functionality on the Windows operating system. This update allows Windows desktop applications that depend on the Windows 10 Universal CRT release to run on earlier Windows operating systems.
Windows 10 이외의 시스템을위한 것입니다. Windows 10 시스템을위한 "공식적인"방법은 없습니다. Windows 7 시스템에서 dll을 복사 할 수있었습니다. 순진하게
PYTHONPATH
에 넣어
(놀랍지 않게) 작동하지 않습니다. 그들이 일을해야한다면 등록이 필요할 것입니다. 그러나 1) Windows 10에서 Windows 7 dll을 등록하면 시스템이 불안정해질 수 있으며 2) 확실히 보편적 인 휴대용 솔루션처럼 보이지는 않습니다.
- 답변 # 1
관련 자료
- node.js - 이름을 모르는 폴더에서 모든 모듈 가져 오기 (nodejs)
- python - pip 설치 후 sendgrid를 가져올 수 없습니다
- pandas - CSV를 읽고 열 데이터를 numpy 배열로 가져 오기
- ios - cocopods없이 프레임 워크 파일을 가져 오는 방법은 무엇입니까?
- 도커를 사용하지 않고 텐서 플로우 서빙 설치
- python - 스크립트가 하위 디렉토리에있을 때 numpy를 가져올 수 없습니다
- vue.js - jest&vue test utils 수동 설치 - 수입 문제
- installation - Python 인터프리터를 통해 Pycharm뿐만 아니라 pip를 통해 chatterbot 패키지를 설치 한 후에도 Chatterbot을 가져올 수 없습니다
- GIT 수하물없이 GIT 리포지토리 파일을 TFS로 가져 오기
- reactjs - eslintrcjs for React 17 and JSX without import 'react'
- 다른 파이썬 파일에 대한 오류없이 가져올 수없는 이유는 무엇입니까? ("부분적으로 초기화 된 모듈에는 속성이 없습니다")
- python - 형식을 변경하지 않고 numpy 배열 부동 값을 읽는 방법은 무엇입니까?
- python - numpy없는 행렬 곱셈
- python - "from numpy import *"를 사용할 수 없습니다
- python - ipynb 노트북을 실행하지 않고 가져 오시겠습니까?
- python - Excel에서 2D numpy 배열로 가져 오는 방법은 무엇입니까?
- sonarqube를 설치하지 않고 sonarqube 스캐너를 실행할 수 있습니까?
- c# - 클라이언트 컴퓨터에 MSMQ를 설치하지 않고 MSMQ 사용
- javascript - 빌드 중에 어떤 것을 알지 못하고 런타임시 Webpack 가져 오기 모듈
먼저. numpy를 사용하거나 사용하지 않고 애플리케이션을 빌드하십시오. 빌드 간의 차이점을 확인하십시오. 와이즈 비즈 두 가지를 의미 할 수 있습니다.
파일을 찾을 수 없습니다
이 pyd 파일의 일부 종속성이 충족되지 않았습니다. http://dependencywalker.com/에서 확인할 수 있습니다.Original error was: No module named 'numpy.core._multiarray_umath'