numexpr icon indicating copy to clipboard operation
numexpr copied to clipboard

numexpr3 lookup.pkl cannot be loaded after bundling with pyinstaller

Open danielhrisca opened this issue 4 years ago • 1 comments

Hello,

I've tried to bundle an application that uses numexpr3 using PyInstaller, but I get to an error at this line https://github.com/pydata/numexpr/blob/numexpr-3.0/numexpr3/ne3compiler.py#L54

This is the error traceback:

Traceback (most recent call last):
  File "myapp\myappgui.py", line 200, in <module>
  File "myapp\myappgui.py", line 127, in main
  File "d:\.jenkins\jobs\CV\tools\myapp\Build\PR-13\ws\myapp\myapp\gui\utils.py", line 31, in <module>
  File "d:\tools\myapp_venv\pyvenv_myapp_python37_x64\lib\site-packages\asammdf\__init__.py", line 14, in <module>
    from .blocks.mdf_v2 import MDF2
  File "d:\tools\myapp_venv\pyvenv_myapp_python37_x64\lib\site-packages\asammdf\blocks\mdf_v2.py", line 4, in <module>
    from .mdf_v3 import MDF3
  File "d:\tools\myapp_venv\pyvenv_myapp_python37_x64\lib\site-packages\asammdf\blocks\mdf_v3.py", line 38, in <module>
    from ..version import __version__
  File "d:\tools\myapp_venv\pyvenv_myapp_python37_x64\lib\site-packages\asammdf\signal.py", line 10, in <module>
    from .blocks import v2_v3_blocks as v3b
  File "d:\tools\myapp_venv\pyvenv_myapp_python37_x64\lib\site-packages\asammdf\blocks\v2_v3_blocks.py", line 13, in <module>
    import numpy as np
  File "d:\tools\myapp_venv\pyvenv_myapp_python37_x64\lib\site-packages\numexpr3\__init__.py", line 33, in <module>
  File "d:\tools\myapp_venv\pyvenv_myapp_python37_x64\lib\site-packages\numexpr3\ne3compiler.py", line 55, in <module>
FileNotFoundError: [Errno 2] No such file or directory: 'd:\\tools\\myapp_venv\\pyvenv_myapp_python37_x64\\lib\\site-packages\\numexpr3\\lookup.pkl'
[13268] Failed to execute script myappgui

basically that paths from the traceback are the ones from the virtual env used to run Pyinstaller, but the bundled application is found somewhere else on the disk.

Is is possible to use the current file location to determine the pkl path instead of using the inspect module?

danielhrisca avatar Mar 29 '21 10:03 danielhrisca

I recall there was some specific reason for doing this and now I cannot remember why.

robbmcleod avatar Mar 30 '21 14:03 robbmcleod

Message to comment on stale issues. If none provided, will not mark issues stale

github-actions[bot] avatar Feb 18 '24 01:02 github-actions[bot]