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

Fromstring data type issue and solution in Python3.10 and newer versions #1987

Open
alikerenciler opened this issue Dec 30, 2024 · 3 comments

Comments

@alikerenciler
Copy link

Hello guys,

I downloaded the newer version of OLA API. When I try to collect the DMX data with Python (py3.10), I came across with an error of:
" AttributeError: 'array.array' object has no attribute 'fromstring'"

To solve this I found 2 ways as follows.

**1. Manually arranging the files of OLA library: **

  • Go to " .local/lib/python3.10/site-packages/ola/ "
  • Open the " OlaClient.py " python script
  • Search for "fromstring" and change them as "frombytes" (there were two function naming changed in OLA 0.10.7 lib)

**2. Downgrading Python version: ** (Not recommended)

  • Create another python environment with Python 3.8.0, and there will be no problem on receiving DMX data.

Have a nice day ;)

@peternewman peternewman changed the title Formstring data type issue and solution in Python3.10 and newer versions Fromstring data type issue and solution in Python3.10 and newer versions Dec 31, 2024
@peternewman
Copy link
Member

Thanks for the heads up @alikerenciler .

This was fixed here:
3ff957f

And then improved/made redundant in:
01bd599

I assume from your comment you were running 0.10.7? As this should be in 0.10.9 onwards.

Do you want to give that version a check and confirm it works as expected for you?

@alikerenciler
Copy link
Author

The problem relays on that the Python's newer versions have no longer fromstring data type support and I do not know the exact reason. This modification should done in OLA Library for further applications.

@alikerenciler
Copy link
Author

Thanks for the updates @peternewman .

The OLA 0.10.9 version is not available on the PyPI webpage. https://pypi.org/project/ola/#history

Even if I try to download with pip the library yields this error of:

$ pip3 install ola==0.10.9
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement ola==0.10.9 (from versions: 0.10.7)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants