Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NumPy 2.x and newbyteorder #578

Open
RuebeDo opened this issue Sep 26, 2024 · 1 comment
Open

NumPy 2.x and newbyteorder #578

RuebeDo opened this issue Sep 26, 2024 · 1 comment
Labels
bug Something isn't working Python 13 Issue will be resolved when Python 13 is supported

Comments

@RuebeDo
Copy link

RuebeDo commented Sep 26, 2024

Describe the bug
26.09.2024 07:43:36 [DEBUG] Drawing Image: BACKGROUND
26.09.2024 07:43:36 [DEBUG] Bitmap res/themes/BigClock/background.png is now loaded in the cache
Traceback (most recent call last):
File "/turing-smart-screen-python-main/main.py", line 192, in module display.display_static_images()
File "/turing-smart-screen-python-main/library/display.py", line 113, in display_static_images self.lcd.DisplayBitmap(
File "/turing-smart-screen-python-main/library/lcd/lcd_comm.py", line 205, in DisplayBitmap self.DisplayPILImage(image, x, y, width, height)
File "/turing-smart-screen-python-main/library/lcd/lcd_comm_rev_a.py", line 234, in DisplayPILImage rgb565le = self.imageToRGB565LE(image)
File "/turing-smart-screen-python-main/library/lcd/lcd_comm_rev_a.py", line 199, in imageToRGB565LE return rgb565.newbyteorder('<').tobytes()
AttributeError: newbyteorder was removed from the ndarray class in NumPy 2.0. Use arr.view(arr.dtype.newbyteorder(order)) instead.
26.09.2024 07:43:36 [INFO] Program will now exit
26.09.2024 07:43:36 [INFO] Waiting for all pending request to be sent to display (5s max)...
26.09.2024 07:43:41 [DEBUG] (5.1s)

To Reproduce
Steps to reproduce the behavior:

  1. Start the script

Expected behavior
Script starts with NumPy 2.x

Environment:

  • Smart screen model: Smart Screen 3.5"
  • Revision of this project: 3.5.0, main branch, latest commit
  • OS with version: Kubuntu 24.04
  • Python version: Python 3.12.3, NumPy 2.1.1
  • Hardware: Intel® Core™ i5-7300U CPU @ 2.60GHz, Mesa Intel® HD Graphics 620
@RuebeDo RuebeDo added the bug Something isn't working label Sep 26, 2024
@mathoudebine
Copy link
Owner

Hello @RuebeDo
Indeed numpy 2.x is not supported for now. You need to use the specified version of numpy from requirements.txt:

numpy~=1.26.4; python_version >= "3.9" # For Python 3.9+

See here to install requirements from requirements.txt: https://github.com/mathoudebine/turing-smart-screen-python/wiki/System-monitor-%3A-how-to-start#3-install-python-dependencies

@mathoudebine mathoudebine added the Python 13 Issue will be resolved when Python 13 is supported label Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Python 13 Issue will be resolved when Python 13 is supported
Projects
None yet
Development

No branches or pull requests

2 participants