Python Forum
pyinstaller not working with acoustics module
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pyinstaller not working with acoustics module
#1
Hi
On Windows 10, the following code in iec_61672_1_2013.py from the acoustics module:
WEIGHTING_DATA = pd.read_csv(
    io.BytesIO(pkgutil.get_data('acoustics', os.path.join('data', 'iec_61672_1_2013.csv'))), sep=',', index_col=0)
causes the single-package executable to fail trying to load some internal data.

File "C:\Users\bayki\AppData\Local\Programs\Python\Python37-32\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\acoustics\standards\iec_61672_1_2013.py", line 43, in <module>
File "pkgutil.py", line 637, in get_data
File "C:\Users\bayki\AppData\Local\Programs\Python\Python37-32\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 475, in get_data
with open(path, 'rb') as fp:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\bayki\\AppData\\Local\\Temp\\_MEI48522\\acoustics\\data\\iec_61672_1_2013.csv'

Is there some way of adding this file as a resource?
Reply
#2
https://pyinstaller.readthedocs.io/en/st...the-bundle
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
Thanks
Finally got it working after reading a number of other posts. It is not immediately obvious that I had to use double quotes and a semi-colon on Windows. After copying the csv file to the local directory the following command worked.

pyinstaller -wF --add-data "iec_61672_1_2013.csv;acoustics\data" kiwiCallFinder.py
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Help with pyinstaller "No module named" korenron 9 9,134 Jun-15-2023, 12:20 PM
Last Post: snippsat
  Problem with Pyinstaller. No module named '_tkinter' tonynapoli2309 0 1,017 May-15-2023, 02:38 PM
Last Post: tonynapoli2309
  working with TLV module Object Jennifer_Jone 3 1,155 Mar-14-2023, 07:54 PM
Last Post: Jennifer_Jone
  Unsure why module is not working garynewport 0 773 Feb-15-2023, 03:21 PM
Last Post: garynewport
  Pandas module not working Hass 2 1,727 Apr-14-2022, 03:13 PM
Last Post: snippsat
  error SimpleITK module with pyinstaller PythonCode12 0 1,605 Jul-08-2020, 12:07 PM
Last Post: PythonCode12
  importing module - not working jdhamblett 3 3,031 Jun-22-2020, 07:33 PM
Last Post: jdhamblett
  'No module named tkinter.messagebox' - PyInstaller ironfelix717 7 8,204 Jan-19-2020, 06:56 AM
Last Post: buran
  setup() from turtle module not working bobfat 7 6,165 Oct-28-2019, 11:05 AM
Last Post: newbieAuggie2019
  import keyboard module doesn't get found - working on laptop but no on raspberry pi.. HANSJORG2 1 8,176 Mar-16-2018, 02:48 PM
Last Post: sparkz_alot

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020