You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
After creating a Pyinstaller build, I'm facing the following Error when I try to run the binary:
Traceback (most recent call last):
File "pydantic\_internal\_validators.py", line 98, in _import_string_logic
File "importlib\__init__.py", line 126, in import_module
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'pydantic.deprecated.decorator'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "pydantic\_internal\_validators.py", line 61, in import_string
File "pydantic\_internal\_validators.py", line 107, in _import_string_logic
ImportError: No module named 'pydantic.deprecated.decorator'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "test_pandera.py", line 1, in<module>
import pandera as pa
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module
File "pandera\__init__.py", line 27, in<module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module
File "pandera\decorators.py", line 26, in<module>
File "<frozen importlib._bootstrap>", line 1075, in _handle_fromlist
File "pydantic\__init__.py", line 386, in __getattr__
File "pydantic\_migration.py", line 287, in wrapper
File "pydantic\_internal\_validators.py", line 63, in import_string
pydantic_core._pydantic_core.PydanticCustomError: Invalid python path: No module named 'pydantic.deprecated.decorator'
[1007164] Failed to execute script 'test_pandera' due to unhandled exception!
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandera.
(optional) I have confirmed this bug exists on the main branch of pandera.
Code Sample, a copy-pastable example
The Temp.zip contains the poetry environment that can be used to quickly reproduce the bug. Temp.zip
The executable should execute without the above error. This error also does not pop up when the script is executed in a python environment.
Desktop (please complete the following information):
Version: 0.19.3
Python version 3.10.6.
OS = Windows 11
Poetry package manager = 1.8..2 (can be irrelevant in this case)
Additional context
I did try to investigate why this was occurring and came across an import in pandera/decorators.py from pydantic (from pydantic import validate_arguments)
This seems to not have any source definition in the current version of pydantic and after some digging seems to have been deprecated on outright replaces in version 2.x of pydantic (can't find the source for this).
I did locate the alternative which should be from pydantic import validate_call in the latest master of pydantic source code.
The text was updated successfully, but these errors were encountered:
Describe the bug
After creating a Pyinstaller build, I'm facing the following Error when I try to run the binary:
Code Sample, a copy-pastable example
The
Temp.zip
contains the poetry environment that can be used to quickly reproduce the bug.Temp.zip
Further steps to reproduce from scratch:
Add a file that just imports pandera called test_pandera.py
eg:
Execute Pyinstaller script to generate binary.
Run the executable:
Expected behavior
The executable should execute without the above error. This error also does not pop up when the script is executed in a python environment.
Desktop (please complete the following information):
Additional context
I did try to investigate why this was occurring and came across an import in
pandera/decorators.py
from pydantic (from pydantic import validate_arguments
)This seems to not have any source definition in the current version of pydantic and after some digging seems to have been deprecated on outright replaces in version 2.x of pydantic (can't find the source for this).
I did locate the alternative which should be
from pydantic import validate_call
in the latest master of pydantic source code.The text was updated successfully, but these errors were encountered: