-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
using pyinstaller leads to FileNotFoundError: 'dimod.libs' #1353
Comments
Can you post the full command you're using that causes the error? I suspect |
Hi @arcondello ! Sure- Easiest way to reduplicate the error is to just set up a new directory called Type Inside the Within the Populate it as so:
From here, you should be able to run the file by typing Then, use pyinstaller to bundle the file into an .exe file by typing After about a minute or so, the bundled file should be created. To access it, type In this directory, type
Note that in my original repository, I fixed this error by setting up a virtual environment in the directory, and then reinstalling Oddly enough, trying to-reduplicate this process in the That said, as you mentioned, it's possible that 'pyinstaller is not not interacting well with the Cython/C++ libraries'... I suspect that both errors are possibly related to this premise? What else can we try to solve this issue? Thanks in advance for your help and attention, Rob |
I see. The issue is that # start delvewheel patch
def _delvewheel_init_patch_1_3_8():
import os
libs_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, 'dimod.libs'))
if os.path.isdir(libs_dir):
os.add_dll_directory(libs_dir)
_delvewheel_init_patch_1_3_8()
del _delvewheel_init_patch_1_3_8
# end delvewheel patch Consequently, Hope this helps. |
Hi! That is a good suggestion and much appreciated. I gave it a shot to manually add the files to the pyinstaller installation using both prescribed ways:
test.spec file and then running as well as 2) adding them via command line via In both cases, after the file compiles, I still get the original Note that I believe I am using pyinstaller correctly because I have also experimented with importing and using the Any additional thoughts you may have on this? Your help is greatly appreciated. :) |
I don't actually have a windows machine handy to reproduce. Can you post here the output of dir dist/test/dimod or the equivalent? I am curious what binaries (if any) it is managing to find. I am also interested in the contents of |
I think what's happening is that I suspect there is some way to fix it via
but you'll need to do some sort of discovery of all of the
I think this is normal, I believe it only needs the |
Yea, that's a good suggestion. I edited my .spec file to collect all dynamic libraries (including .pyd files) imported by test.spec block_cipher = None a = Analysis( -# collect all dynamic libraries (including .pyd files) imported by your application- -# add the required modules to the hidden imports list- and that issue seems to go away. However, a new issue then arises, which I'm not sure if is still related to the Thanks, |
Alright, so trying another way to import the
leads to the following Not sure if this error message is more easily solved than the previous one? Is there a way to break apart the dimod package so that its submodules are more easily accessed? |
Unfortunately we have exceeded my knowledge of
Do you mean only installing the parts of dimod that you need for your program? Or something else? |
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:
Steps To Reproduce
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
Additional Context
Not sure if this is a dimod error, or a pyinstaller error? Thanks,
The text was updated successfully, but these errors were encountered: