dwavesystems / dwavesystems/dimod

using pyinstaller leads to FileNotFoundError: 'dimod.libs'

Open
#1,353 10 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
143
Forks
91
Avg merge
1h 24m
Merged PRs (30d)
3

Description

**Description**

Hello, for testing purposes, I'm trying to use pyinstaller to bundle the dwave- simulated annealing algorithm into a custom pyqt app that I'm building. In this custom app, I can successfully import and run successfully the dwave-sa algorithm. However, when I try to bundle the app and run it using pyinstaller, I get the error:
```
File "PyInstaller\loader\pyimod02_importers.py", line 385, in exec_module
File "dimod\__init__.py", line 18, in
File "dimod\__init__.py", line 9, in _delvewheel_init_patch_1_0_1
File "os.py", line 1118, in add_dll_directory
FileNotFoundError: [WinError 2] 。: 'C:\\Users\\robli\\projects\\python\\final\\pyqt5\\dist\\main\\dimod.libs'
[2848] Failed to execute script 'main' due to unhandled exception!
```
**Steps To Reproduce**
1) create a simple app that uses dwave-sa to run a test function
2) attempt to bundle this app into an executable file (i.e. .exe) using Pyinstaller

The error occurs when you try to bundle the file using Pyinstaller.

**Expected Behavior**
This error should not occur when you attempt to bundle the app.

As a side note, looking at the Dimod directory tree, I cannot find this ``libs`` folder anywhere. So, not sure why the pyinstaller is even looking for this folder?

**Environment**
- OS: Windows 10
- Python version: 3.10.11

**Additional Context**
Not sure if this is a dimod error, or a pyinstaller error? Thanks,

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.