flet icon indicating copy to clipboard operation
flet copied to clipboard

No module named

Open claudioaguiarg opened this issue 1 year ago • 2 comments

I had this problem with 2 libs that I tried to use in flet, and it gave the same problem, the first lib is cx_Oracle and the second is oracledb.

Traceback (most recent call last): File "", line 43, in File "", line 229, in run_module File "", line 88, in _run_code File "C:\Users\claud\AppData\Roaming\Local\Temp\serious_python_tempb0bb1aed\main.py", line 2, in ModuleNotFoundError: No module named 'oracledb'

claudioaguiarg avatar May 28 '24 20:05 claudioaguiarg

I think this issue is same as #2611 where flet did not package the Python libraries in virtual environment instead using global Python libraries. This can be fixed by copying the whole 'site-packages' directory from .venv to the flet build's 'site-packages' directory.

tyu1996 avatar May 31 '24 13:05 tyu1996

I think this issue is same as #2611 where flet did not package the Python libraries in virtual environment instead using global Python libraries. This can be fixed by copying the whole 'site-packages' directory from .venv to the flet build's 'site-packages' directory.

I raised this issue https://github.com/flet-dev/flet/issues/3447 according to your comments with my own suggestion for packaging python project in general. Hopefully we can fix the build issue soon.

duyanh-y4n avatar Jun 11 '24 11:06 duyanh-y4n

Please give the latest Flet version a try.

ndonkoHenri avatar Dec 01 '24 15:12 ndonkoHenri