python打包不能在其他电脑打开、找不到指定模块,pyinstaller打包移植到别的电脑报错OSError: [WinError 126] 找不到指定的模块。...
首先說一下我的環境 win10 python3.6.4
下面是我安裝庫 版本 pip list
Package???????? Version
--------------- --------------
altgraph??????? 0.15
certifi???????? 2018.4.16
chardet???????? 3.0.4
future????????? 0.16.0
GDAL??????????? 2.2.4
graphviz??????? 0.8.4
idna??????????? 2.6
macholib??????? 1.9
mxnet-cu90????? 1.3.0b20180724
numpy?????????? 1.14.5
opencv-python?? 3.4.2.17
pandas????????? 0.23.3
pefile????????? 2017.11.5
Pillow????????? 5.2.0
pip???????????? 18.0
PyInstaller???? 3.3.1
pypiwin32?????? 223
python-dateutil 2.7.3
pytz??????????? 2018.5
pywin32???????? 223
requests??????? 2.18.4
setuptools????? 28.8.0
six???????????? 1.11.0
urllib3???????? 1.22
其中深度學習庫mxnet用的cu90
2 另一臺電腦也是win10 安裝了的anconda,沒裝什么庫純屬自帶
結果報錯
Traceback (most recent call last):
File "site-packages\PyInstaller\loader\pyiboot01_bootstrap.py", line 149, in __init__
File "ctypes\__init__.py", line 348, in __init__
OSError: [WinError 126] 找不到指定的模塊。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "ship_detect.py", line 10, in
File "", line 971, in _find_and_load
File "", line 955, in _find_and_load_unlocked
File "", line 665, in _load_unlocked
File "d:\program files\python\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
File "inference_coord.py", line 11, in
File "", line 971, in _find_and_load
File "", line 955, in _find_and_load_unlocked
File "", line 665, in _load_unlocked
File "d:\program files\python\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
File "site-packages\mxnet\__init__.py", line 24, in
File "", line 971, in _find_and_load
File "", line 955, in _find_and_load_unlocked
File "", line 665, in _load_unlocked
File "d:\program files\python\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
File "site-packages\mxnet\context.py", line 24, in
File "", line 971, in _find_and_load
File "", line 955, in _find_and_load_unlocked
File "", line 665, in _load_unlocked
File "d:\program files\python\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
File "site-packages\mxnet\base.py", line 197, in
File "site-packages\mxnet\base.py", line 188, in _load_lib
File "site-packages\PyInstaller\loader\pyiboot01_bootstrap.py", line 151, in __init__
__main__.PyInstallerImportError: Failed to load dynlib/dll 'E:\\ship_detect\\mxnet\\libmxnet.dll'. Most probably this dynlib/dll was not found when the application was frozen.
[5748] Failed to execute script ship_detect
3
OSError: [WinError 126] 找不到指定的模塊。Failed to load dynlib/dll 一般這個錯誤是因為dll庫有其他的依賴庫未被找到,我們的這個libmxnet.dll 肯定有其他的依賴庫未被找到,我們通過一個軟件Dependency Walker 查找他的依賴庫
我們看到那六個打問好的,在電腦上找到它大部分是在c盤 是我們gpu所用的庫。
最終如下:其中應該有沒有用的庫,這里我沒有仔細甄別。
總結
以上是生活随笔為你收集整理的python打包不能在其他电脑打开、找不到指定模块,pyinstaller打包移植到别的电脑报错OSError: [WinError 126] 找不到指定的模块。...的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python gpiozero,树莓派远
- 下一篇: websocket python爬虫_p