Use LVGL with Python3

that’s strange it shouldn’t be doing that. it is set to work with python 3.9 and up and you are using python 3.9.

that is the error you are having. I really do hate this new way they are handling the build system it is causing all kinds of problems and things are broken all over the place. I attempted to come up with a work around for the issue and it works on Windows but apparently it doesn’t work on Linux. How annoying.

Not a big deal, it’s really simple to compile it on Linux. Could you tell me what is latest method to build it locally?

what you just did is the latest method. LOL

or you can clone the master branch and type in python setup.py install. That should also work.

:smiley:

No luck :frowning:

python3 setup.py install
Traceback (most recent call last):
  File "/home/kisvegabor/projects/lvgl/python3/lv_cpython/setup.py", line 12, in <module>
    from builder import utils, build, install
  File "/home/kisvegabor/projects/lvgl/python3/lv_cpython/builder/__init__.py", line 2, in <module>
    from .build import build as _build
  File "/home/kisvegabor/projects/lvgl/python3/lv_cpython/builder/build.py", line 5, in <module>
    from setuptools.command.build import build as _build  # NOQA
ModuleNotFoundError: No module named 'setuptools.command.build'

OYE!!!

I have to make a requirements file. In the mean time since you have cloned the repo try and run this command from the root of the repo.

python -m pip install . don’t forget the dot on the end there.

See if you get that same blasted builder error.

python -m pip install . works like a charm. The examples are working too! :metal:

Most of the examples should be working.

I have a glitch with the MicroPython Binding and the groups. I need to get that fixed. I have started working out a way to cast from say an lv_color_t array to a uint8_t array without the user having to do anything special. Really need to get those *'s removed and the []'s added in order to be able to do that properly. Otherwise CFFI treats it as a pointer instead of an array and I get errors when the data gets accessed later on down the line in C code. It is usually an access violation which is not the easiest thing to track down what the cause of the problem is. If it spat back an error when it was passed much easier to locate the issue.

Oh you guys are going to love this conversation with this dinkleberry over at python packaging. I am trying to get the problem with the linux install fixed and this guy is all about finger pointing when he isn’t sure where the problem is actually coming from.

Maybe if more people jump into this conversation and tell this idiot that it’s his responsibility to get it fixed he might get off his ass to get it done.

well the conversation with that fool has ended and how he is handling it is by passing the buck. So I said I can do that too and since the problem is not in my code and only shows up when using pip then anyone that experiences the issue should go and open up an issue in the repo for pip. I don’t have any concrete confirmation of where the actual problem is and since it is only showing up when using pip that is where I am going to assume the problem exists and that is where I will direct people to open an issue.

It seems emotions got unleashed. Sorry but I would rather not comment on it. Sometimes it’s really complicated to discuss things. Different people, different goals, different culutre, different background…

1 Like

I haven’t even looked at what was said after my last comment. I washed my hands of it. I understand that the person is a “volunteer” but that doesn’t mean they push things off onto other people. pip and setuptools are both handled by the python packaging authority. they are not 2 completely separate libraries. they work with each other and neither can function properly without the other and still have the same capabilities. pip is like the front end and setuptools the back end. pip is not able to compile or build anything and setuptools soon will not be able to install anything (it can as of right now but those features are being removed).

Neither the guy at pip or the person at setuptools can explain why pip install lvgl fails and python -m pip install lvgl works. That is the reason why they should be directly handling the issue with each other. having a user in the middle passing information between the 2 is just plain dumb to do.

Here is an example…

Say I ran into an issue using the micropython binding. would you tell me to go and talk to the people over at micropython right out of the gate without doing any kind of investigation into where the exact problem is coming from? Or do you investigate first to isolate the issue and once it is 100% known that it is not a problem specific to the LVGL binding then send a person over. I think I know you well enough at this point to say that you would do neither of those things. I am pretty sure you would more than likely go and report the issue yourself. Do you get paid for the support you provide?? Nope. you are a volunteer. so why are you not passing the buck like that other guy did?

See where I am coming from. The problem is the majority of the developers that works on Python have the same mentality as the guy that “helped” (not) me. Not all of them are like that but the majority are. I went round and round with one that committed a change and it got released without that change ever being tested to make sure it wouldn’t cause problems on operating systems other than Linux. It turns out it complete killed the ability to access the Windows API functions for about 30% of the Windows API. The guy simply did not want to revert the changes. once there was about 500 people making noise about it then it finally got reverted but someone else stepped in and did it. the person that made the changes and committed then refused to remove it saying that the issue is being caused by a bug in libffi and his code was not what is causing the problem.

In this case I am almost sure the problem is in pip and how it is setting up the environment and I believe the guy over at setup tools also is thinking the same thing. I am in a holding pattern to find out what they come up with. It has been several days since the last reply from the last response I have gotten from the people over at setuptools. They agree there is a glitch but there is also a work around for that glitch. it is a matter of them determining if it is going to cause people to report having a problem. It is actually something that can be fixed for all platforms except Linux. I am not sure why the issue is not able to be corrected for Linux the same was as it is corrected for other OS’s.

I would leave it alone for the time being, if they correct it they will correct it otherwise to install lvgl on Linux people will have to use python -m pip install lvgl instead of being able to use pip install lvgl

What am I missing ??
I am using Windows 11 / Python 3.11.3
and “Successfully installed pip-23.2.1 setuptools-68.2.2 wheel-0.41.2”

PS D:\SmartLOG_V2\LV-cpython-pc\lv_cpython> python -m pip install .
Processing d:\smartlog_v2\lv-cpython-pc\lv_cpython
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [29 lines of output]
      Traceback (most recent call last):
        File "C:\Users\rlsap\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "C:\Users\rlsap\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\rlsap\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\rlsap\AppData\Local\Temp\pip-build-env-ux9p54z1\overlay\Lib\site-packages\setuptools\build_meta.py", line 355, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\rlsap\AppData\Local\Temp\pip-build-env-ux9p54z1\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in _get_build_requires
          self.run_setup()
        File "C:\Users\rlsap\AppData\Local\Temp\pip-build-env-ux9p54z1\overlay\Lib\site-packages\setuptools\build_meta.py", line 341, in run_setup
          exec(code, locals())
        File "<string>", line 49, in <module>
        File "C:\Users\rlsap\AppData\Local\Temp\pip-build-env-ux9p54z1\overlay\Lib\site-packages\pyMSVC\__init__.py", line 3968, in setup_environment
          environment = Environment(
                        ^^^^^^^^^^^^
        File "C:\Users\rlsap\AppData\Local\Temp\pip-build-env-ux9p54z1\overlay\Lib\site-packages\pyMSVC\__init__.py", line 3727, in __init__
          self.windows_sdk = WindowsSDKInfo(
                             ^^^^^^^^^^^^^^^
        File "C:\Users\rlsap\AppData\Local\Temp\pip-build-env-ux9p54z1\overlay\Lib\site-packages\pyMSVC\__init__.py", line 2234, in __init__
          self.vc_version = c_info.version
                            ^^^^^^^^^^^^^^
        File "C:\Users\rlsap\AppData\Local\Temp\pip-build-env-ux9p54z1\overlay\Lib\site-packages\pyMSVC\__init__.py", line 1148, in version
          raise RuntimeError(
      RuntimeError: No Compatible Visual C\C++ version found.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
PS D:\SmartLOG_V2\LV-cpython-pc\lv_cpython>

This is a long thread but I thought the issue with PIP was only with Linux.
I saw the heated discussion @kdschlosser had with PIP maintainer, suggested using
sys.path.append(os.path.dirname(os.path.abspart(file))
I am absolutely ignorant to the consequences of messing with “PATHS”.
@kdschlosser do you recommend this fix or not.

@kdschlosser this project is Great and I am very anxious to get this up and running.
I did not see any mention of the command “python -m pip install .” in the lv_cpython website.
Is this due to the fact that the issue with pip has not been resolved?
I think it would be great if you could create a video that walks people through the installing, setting up and running of the application.
By the way, ignore that last post meddler in the PIP discussion.
Just a person who thinkgs there on higher authority than everone else.

I am sorry I have not had as much time as I have wanted to have to work on this project. I will be getting more time in month or 2 to be able to spend working on it.

As far as the error you are getting it is telling you exactly what the problem is.

No Compatible Visual C\C++ version found.

Because of how pip and setuptools now work the traceback information gets mangled into the error you are seeing but the original traceback information is still contained in it.

so you need to install a compatible Visual C++ compiler. You can either install the latest Visual Studio and select that you want to install the C++ compiler with it along with the latest Windows SDK. Or you can install the latest Visual Studio Build Tools which will install all of the latest C++ compiler stuff without installing the Visual Studio IDE.

Visual Studio

Build Tools
https://aka.ms/vs/17/release/vs_BuildTools.exe

i just really flew over those great bindings while making a wasm wheel for them (now avail in pygame-web pygbag) so i’m wondering :

is it possible to use framebuffer only (without SDL2 at all) and let people blit themselves ?

Major interest would be wasi+sixel/webgl/webgpu port without sdl2 involved in compilation at all.

run from a gist test

It sure is. I actually provided an example of how to do it with wxPython.

1 Like

If you wanted to compile it without SDL then you would need to change lv_conf so it doesn’t use SDL and remove SDL from the libraries variable in the setup.py file.

1 Like

how to install lvgl in python3.12

I still get this error as of Oct 2024:

python3 --version
Python 3.12.3

python3 -m pip install build --break-system-packages
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: build in /home/electronicsguy/.local/lib/python3.12/site-packages (1.2.2)
Requirement already satisfied: packaging>=19.1 in /usr/lib/python3/dist-packages (from build) (24.0)
Requirement already satisfied: pyproject_hooks in /home/electronicsguy/.local/lib/python3.12/site-packages (from build) (1.2.0)


python3 -m pip install lvgl --break-system-packages
Defaulting to user installation because normal site-packages is not writeable
Collecting lvgl
  Using cached lvgl-0.1.1b0.tar.gz (3.6 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [18 lines of output]
      Traceback (most recent call last):
        File "/usr/lib/python3/dist-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/usr/lib/python3/dist-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/lib/python3/dist-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-2ab_c4l8/overlay/local/lib/python3.12/dist-packages/setuptools/build_meta.py", line 332, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-2ab_c4l8/overlay/local/lib/python3.12/dist-packages/setuptools/build_meta.py", line 302, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-2ab_c4l8/overlay/local/lib/python3.12/dist-packages/setuptools/build_meta.py", line 318, in run_setup
          exec(code, locals())
        File "<string>", line 11, in <module>
      ModuleNotFoundError: No module named 'builder'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

would love to know how this project goes… I am not good enough with coding otherwise I want to jump in to help :smiley: