Problem importing flet_lottie and flet_charts when updating to 1.0 Alpha
Duplicate Check
- [x] I have searched the opened issues and there are no duplicates
Describe the bug
When I import lottie and now flet-charts they give me errors and the only thing I did was updating flet to 1.0 alpha:
Errors from lottie:
No module named 'flet.core'
Errors from charts:
AttributeError: type object 'Alignment' has no attribute 'center_left' begin: Alignment = field(default_factory=lambda: Alignment.center_left())
that error x10 with other atributes
Code sample
Code
import flet_lottie
import flet_charts
To reproduce
import flet_lottie import flet_charts
Expected behavior
...
Screenshots / Videos
Captures
[Upload media here]
Operating System
Windows
Operating system details
11
Flet version
latest
Regression
Yes, it used to work in a previous Flet version (please specify the version in additional details)
Suggestions
No response
Logs
Logs
[Paste your logs here]
Additional details
Also, how can I pip install older flet versions so I dont have to adapt mi code to every release?
Thanks for reporting. Will be fixed asap.
Also, how can I pip install older flet versions so I dont have to adapt mi code to every release?
pip install 'flet[all] == 0.x.y'
# or
pip install --force-reinstall 'flet[all]==0.x.y'
Thanks!
Also, talking about this:
pip install 'flet[all] == 0.x.y' pip install --force-reinstall 'flet[all]==0.x.y'
I meant installing a previous branch of the same release so I can be deterministic with the properties of the installation.
The problem is that, when I reinstall 0.28.3 or 0.27.0 or whatever, the new installation is not the same as always because some features of the new releases, like the 1.0 alpha now, are being included. Its this possible or im making some mistake?
If you are in a new virtual environment, this wont happen. If you are already in a venv, I will suggest you recreate. There are several guides online depending on your package manager.
Also, your original issue with alpha should have been fixed now. Steps to install: https://flet.dev/blog/introducing-flet-1-0-alpha/#trying-flet-10-alpha
Installing Flet:
pip install --pre 'flet[all]>=0.70.0.dev0'
# or
uv pip install "flet[all] >=0.70.0.dev0" --prerelease=allow
# or
uv add 'flet[all]>=0.70.0.dev0' --prerelease=allow
Installing an extension:
pip install 'flet-lottie >=0.2.0.dev0'
# or
uv pip install "flet-lottie >=0.2.0.dev0"
# or
uv add 'flet-lottie >=0.2.0.dev0'
Give it a try and let know.
Everything that you said worked perfectly in the new virtual enviroment but a new issue appears on screen when opening the apk in device when building with a new uv:
-
numpy requires libc++_shared.so -
Unable to open libpenguin.so: dlopen failed: library libpenguin.so not found. (in logcat too) -
module certifi not found
Do you want me to open a new github issue for this? Thanks.
Can you share more info to repro the new errors? Your platform/OS, exact Flet version, code, etc.
Sure, I created a new uv virtual enviroment following docs, with flet 0.28.3 on windows 11, uv added numpy 2.2.2 and latest certifi on toml.
I cant share my code because of his magnitude, but I think its something related with the building process not the code.
When I build my apk everythings fine, but:
When opening app in android studio emulator, a white screen shows a long traceback error with one of the 2 first errors above, all related with numpy.
When opening in real device, only show a single line traceback with "module certifi not found".
Before creating this new enviroment and project, the usage of numpy forced me to include certifi and flet-libccp-shared on toml, a direct recomendation from Feodor that worked.