-
Notifications
You must be signed in to change notification settings - Fork 80
Using pyinstaller to compile a simple code with oracledb throws an error in the executable file #31
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
Comments
This is not a bug in python-oracledb. Running this independently of PyInstaller works correctly, right? The line containing the error has this:
You probably need to make sure that module is availble, too, in your frozen executable. I'm not overly familiar with PyInstaller so you'll have to work with it yourself to figure out how to do that! |
I have also got the same issue as OP, however I was able to resolve it after struggling with it for some hours. Basically, you will need to specify full path to pbkdf2 module with the In my case, I already have the .spec file created by PyInstaller, so I just added the path in the 'hiddenimports' field like this -
Once done, I was able to successfully build and run the executable file without any issue |
Thanks, @reedark95! @horstrand, does this resolve your issue as well? If so, I think we can close this issue. |
Yes, it worked very well! |
Also see #57 for another solution. |
Hello everyone, I had the same problem exposed, thanks to this chain of messages I managed to solve it. However, when I run the .exe and do a query it gives me an error. when I run my code from jupyter, there is no problem. |
I am trying to compile a test code that simply connects to an oracle datable using pyinstaller.
I'm doing it with the --onefile option as shown below:
pyinstaller test_oracle.py --onefile
When I later run the executable, at first I got a few errors, just some modules that were missing ('secrets', 'ssl', 'getpass', 'cryptography'). I fixed it with the option --hidden-import from pyinstaller.
After fixing that, a new error showed up, which I have not been able to fix:
Traceback (most recent call last):
File "test_oracle.py", line 1, in
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "oracledb_init_.py", line 38, in
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "oracledb\connection.py", line 39, in
File "src\oracledb\impl/thin/crypto.pyx", line 35, in init oracledb.thin_impl
ImportError: cannot import name pbkdf2
[18124] Failed to execute script 'test_oracle_sac' due to unhandled exception!
I have tried importing the module in different ways and it still does not work.
Any help would be appreciated!
oracledb==1.0.1
python 3.10.0
pyinstaller==5.1
The text was updated successfully, but these errors were encountered: