I am using darkflow for custom object detection it is working perfectly fine and it is running perfectly through anaconda prompt. I made the exe using pyinstaller, So when I was running the exe it is showing the above error. Can anyone help me to get rid of this? I tried installing darkflow globally also but it didn't work.
Traceback (most recent call last):
File "demo.py", line 1, in <module>
from darkflow.net.build import TFNet
File "c:\users\camfyvision\anaconda3\envs\darkflow\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
exec(bytecode, module.__dict__)
File "darkflow\net\build.py", line 7, in <module>
from .framework import create_framework
File "c:\users\camfyvision\anaconda3\envs\darkflow\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
exec(bytecode, module.__dict__)
File "darkflow\net\framework.py", line 1, in <module>
from . import yolo
File "c:\users\camfyvision\anaconda3\envs\darkflow\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
exec(bytecode, module.__dict__)
File "darkflow\net\yolo\__init__.py", line 2, in <module>
from . import predict
File "c:\users\camfyvision\anaconda3\envs\darkflow\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
exec(bytecode, module.__dict__)
File "darkflow\net\yolo\predict.py", line 7, in <module>
from ...cython_utils.cy_yolo_findboxes import yolo_box_constructor
File "c:\users\camfyvision\anaconda3\envs\darkflow\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 714, in load_module
module = loader.load_module(fullname)
File "darkflow\cython_utils\cy_yolo_findboxes.pyx", line 1, in init darkflow.cython_utils.cy_yolo_findboxes
import numpy as np
ModuleNotFoundError: No module named 'darkflow.cython_utils.nms'
This is the error I got when I did drag and drop of the exe into propmt and also I am providing below the corresponding information I got regarding the error when I was making the exe using pyinstaller.
136360 INFO: Updating manifest in C:\Users\CamfyVision\AppData\Roaming\pyinstaller\bincache00_py36_64bit\darkflow.cython_utils.cy_yolo_findboxes.pyd
136361 INFO: Updating resource type 24 name 2 language 1033
136413 INFO: Updating manifest in C:\Users\CamfyVision\AppData\Roaming\pyinstaller\bincache00_py36_64bit\darkflow.cython_utils.cy_yolo2_findboxes.pyd
136414 INFO: Updating resource type 24 name 2 language 1033
Related
I did pyinstaller --onefile main.py in command prompt
This made the exe in a folder called dist where my project is which I then ran in command prompt and got the error below:
DevTools listening on ws://127.0.0.1:49451/devtools/browser/b4cedddd-0d98-4929-8fdb-b92d174992cc
[18704:11556:1103/114958.968:ERROR:device_event_log_impl.cc(214)] [11:49:58.968] USB: usb_device_handle_win.cc:1048 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)
[18704:11556:1103/114958.968:ERROR:device_event_log_impl.cc(214)] [11:49:58.968] USB: usb_device_handle_win.cc:1048 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)
Traceback (most recent call last):
File "pandas\compat\_optional.py", line 138, in import_optional_dependency
File "importlib\__init__.py", line 126, in import_module
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
File "openpyxl\__init__.py", line 6, in <module>
File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
File "openpyxl\workbook\__init__.py", line 4, in <module>
File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
File "openpyxl\workbook\workbook.py", line 9, in <module>
File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
File "openpyxl\worksheet\_write_only.py", line 13, in <module>
File "openpyxl\worksheet\_writer.py", line 23, in init openpyxl.worksheet._writer
ModuleNotFoundError: No module named 'openpyxl.cell._writer
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "main.py", line 1, in <module>
import newspapers as np
File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
File "newspapers.py", line 16, in <module>
from constants import driver
File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
File "constants.py", line 9, in <module>
df = pd.read_excel('MOPI Template News & Mags.xlsx', sheet_name='Passwords')
File "pandas\util\_decorators.py", line 311, in wrapper
File "pandas\io\excel\_base.py", line 457, in read_excel
File "pandas\io\excel\_base.py", line 1419, in __init__
File "pandas\io\excel\_openpyxl.py", line 524, in __init__
File "pandas\compat\_optional.py", line 141, in import_optional_dependency
ImportError: Missing optional dependency 'openpyxl'. Use pip or conda to install openpyxl.
[2500] Failed to execute script 'main' due to unhandled exception!
I'm using python version 3.10 - i coded this program in a virtual environment where i have all the modules. When i run pip list it shows I do have openpyxl 3.0.10.
I saw a suggestion to try update the auto generated spec file and use hidden_imports variable for the modules that are missing - so I followed a video online which advised to update lines so had below added/amended:
from PyInstaller.utils.hooks import collect_submodules
hidden_imports = collect_submodules('openpyxl')
hiddenimports=hidden_imports,
I got the exact same error after trying this.
The program runs fine when in PyCharm but not when run this exe I've created. I also made sure to try run using the terminal in PyCharm too. Any ideas why I'm still getting this error?
When you open the dist folder, do you see the openpyxl module? If not, try to do it via the add-data or hidden-import. Or even easier, just copy paste it manually and see if that works. Like pyinstaller file.py --hidden-import=openpyxl
You could either try updating your pyhooks-contrib as it could have been fixed
Having an import issue when running the exe (as onefile) created by pyinstaller I added 'falcon.responders' to the list of hidden imports. But still the import error when running the executable. What can be wrong?
Traceback (most recent call last):
File "s2rdf.py", line 62, in <module>
import morph_kgc
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "morph_kgc\__init__.py", line 16, in <module>
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "morph_kgc\engine.py", line 16, in <module>
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "morph_kgc\materializer.py", line 14, in <module>
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "falcon\__init__.py", line 32, in <module>
File "falcon\app.py", line 24, in init falcon.app
ImportError: cannot import name responders
[16196] Failed to execute script 's2rdf' due to unhandled exception!
Snippet from spec file
a = Analysis(
['s2rdf.py'],
pathex=[],
binaries=[],
datas=[],
hiddenimports=['falcon.app_helpers','falcon.responders'],
hookspath=[],
hooksconfig={},
I had a similar problem, but it was fixed by removing the last generated directories ("build" and "dist") and using this hidden import list:
hiddenimports=['falcon.app_helpers', 'xml.etree', 'falcon.responders', 'xml.etree.ElementTree']
So this is the error it's throwing in cmd windows 10. Seems to be something to do with pynput? Not really sure what I can do to fix this and appreciate any help.
C:\Users\Michael\Desktop\herprogram\dist\beeb>beeb.exe
Traceback (most recent call last):
File "C:\Users\Michael\Desktop\herprogram\beeb.py", line 5, in <module>
import pynput
File "c:\python38\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 493, in exec_module
exec(bytecode, module.__dict__)
File "pynput\__init__.py", line 40, in <module>
File "c:\python38\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 493, in exec_module
exec(bytecode, module.__dict__)
File "pynput\keyboard\__init__.py", line 31, in <module>
File "pynput\_util\__init__.py", line 76, in backend
ImportError
[11880] Failed to execute script beeb
Many thanks
I switched to a different module pywinauto which is officially supported by pyinstaller and used:
import pywinauto
pywinauto.mouse.double_click(button='left', coords=(0, 0))
This solved the issue. Thanks guys
Trying to distribute a program that relies on tensorflow...
Using tensorflow it works nicely both as script and with pyinstaller.
Using tensorflow-gpu it works as script but not with pyinstaller.
The cuda and cudnn dlls have been copied into the bundle folder by pyinstaller.
I use python 3.6.5 and tensorflow 1.7.0. (Can change version if it helps...)
Error message:
Traceback (most recent call last):
File "site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in
File "c:\users\aleks\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
exec(bytecode, module.dict)
File "site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in
File "site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 17, in swig_import_helper
File "importlib__init__.py", line 126, in import_module
ModuleNotFoundError: No module named 'tensorflow.python._pywrap_tensorflow_internal'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "interface.py", line 14, in
File "c:\users\aleks\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
exec(bytecode, module.dict)
File "site-packages\tensorflow__init__.py", line 24, in
File "c:\users\aleks\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
exec(bytecode, module.dict)
File "site-packages\tensorflow\python__init__.py", line 49, in
File "c:\users\aleks\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
exec(bytecode, module.dict)
File "site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in
ImportError: Traceback (most recent call last):
File "site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in
File "c:\users\aleks\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
exec(bytecode, module.dict)
File "site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in
File "site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 17, in swig_import_helper
File "importlib__init__.py", line 126, in import_module
ModuleNotFoundError: No module named 'tensorflow.python._pywrap_tensorflow_internal'
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/install_sources#common_installation_problems
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
[10816] Failed to execute script interface
Make sure you are also packaging MSVCP140.DLL, as missing this from the %PATH% can throw this error.
I tend to use cx_Freeze instead of pyinstaller when distributing tensorflow applications. Once you overcome the error cx_Freeze has with scipy, it's simpler overall.
Maybe this can help. I manually rename the file _pywrap_tensorflow_internal.pyd to tensorflow.python._pywrap_tensorflow_internal.pyd in the dist folder. Everything works.
I fixed this problem by making dirs as ".../dist/[MmyPyName]/tensorflow/python/_pywrap_tensorflow_internal.pyd"
tensorflow-gpu = 1.10.0
python = 3.6.2
cuda = 9.0
cudnn = 7.3.0
When installing it with pyinstaller, make sure that in the .spec file include this as hidden import:
hiddenimports=['tensorflow.python._pywrap_tensorflow_internal',],
This will include the missing module in the correct path.
I wrote a program using PyQt4.QtGui and QtCore,I packaged it into exe,and it works good on my computer,but it can't run on others' computer
The error is this:
cx_Freeze: Python error in main script
---------------------------
Traceback (most recent call last):
File "C:\Python33\lib\site-packages\cx_Freeze\initscripts\Console3.py", line 27, in <module>
File "baidu.py", line 6, in <module>
File "C:\Python\32-bit\3.3\lib\importlib\_bootstrap.py", line 1607, in _handle_fromlist
File "C:\Python\32-bit\3.3\lib\importlib\_bootstrap.py", line 313, in _call_with_frames_removed
File "C:\Python\32-bit\3.3\lib\importlib\_bootstrap.py", line 1558, in _find_and_load
File "C:\Python\32-bit\3.3\lib\importlib\_bootstrap.py", line 1525, in _find_and_load_unlocked
File "ExtensionLoader_PyQt4_QtGui.py", line 11, in <module>
ImportError: DLL load failed: 找不到指定的模块。
The packaged files are:
├─_bz2.pyd
├─_hashlib.pyd
├─_socket.pyd
├─_ssl.pyd
├─baidu.exe
├─icudt49.dll
├─icuin49.dll
├─icuuc49.dll
├─LIBEAY32.dll
├─libGLESv2.dll
├─lxml.etree.pyd
├─PyQt4.QtCore.pyd
├─PyQt4.QtGui.pyd
├─PyQt4.QtNetwork.pyd
├─python33.dll
├─Qt5Core.dll
├─Qt5Gui.dll
├─Qt5Network.dll
├─Qt5PrintSupport.dll
├─Qt5Widgets.dll
├─sip.pyd
├─SSLEAY32.dll
└─unicodedata.pyd
I just used "cxfreeze baidu.py --base-name=Win32GUI --target-dir d:\123" to package it.
I wonder if I missed some arguments when using cxfreeze result in this problem,and how to package it to exe.Thank you
d3dcompiler_43.dll is needed to run pyqt