When attempting to convert my .py file to a .exe, the conversion goes as planned but when running the .py file I get the following errors:
`Traceback (most recent call last):
File <Filename>, line 17, in <module>
File "PyInstallerloaderpyimod02_importers.py", line 419, in exec_module
File "pandas__init__.py", line 47, in <module>
ImportError: Unable to import required dependencies:
numpy: Error importing numpy: you should not try to import numpy from
its source directory; please exit the numpy source tree, and relaunch your python
interpreter from there.
[27328] Failed to execute script <Filename> due to unhandled exception!`
The script itself uses Pandas, so I believe I need numpy to be available.
How would I go about correcting this issue with the numpy dependency permanently?
I’ve tried multiple versions of both packages and am currently on the newest ones.
I’ve tried –hidden-import numpy without success or difference.
I’ve tried looking up similar solutions, but when researching this across StackOverflow, the most relevant answers I find refer to upgrading or downgrading packages due to PyInstaller and Numpy not playing nicely together, however the posts are old and outdated by several years and don’t help in my situation.
Numpy – 1.26.4
PyInstaller – 6.7.0
Bobby McGraw is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.