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

Please help fix error #57

Open
Electrik-rich546456 opened this issue Dec 7, 2021 · 10 comments
Open

Please help fix error #57

Electrik-rich546456 opened this issue Dec 7, 2021 · 10 comments

Comments

@Electrik-rich546456
Copy link

Hi @trainman419 I hope you can help me fix this. I receive this error when trying the example code in the readme.

<module '_cec' from '/usr/lib/python3/dist-packages/_cec.cpython-38-x86_64-linux-gnu.so'>Exception "unhandled AttributeError" module 'cec' has no attribute 'init' File: /home/user/Documents/Python works/cec codes/my_pycecclient2.py, Line: 4

@trainman419
Copy link
Owner

trainman419 commented Dec 7, 2021

Hrm... that should work, because that API hasn't changed in a long time. Is it possible you have a different python cec module that might be getting loaded instead of this one?

@Electrik-rich546456
Copy link
Author

how do i find out if that is the case ?
how do i change it back or make changes to the api ?

@trainman419
Copy link
Owner

Typically, your version of Linux will have a package manager that is used to install system packages, including system-wide python packages. Python also has the PIP tool which can be used to install python packages.

You should check your system's package manager and PIP (try pip list) to see if there's another python CEC package installed.

@Electrik-rich546456
Copy link
Author

cec 0.2.7
no python-cec though.

@trainman419
Copy link
Owner

It looks like you may also have the PulseEight python 3 CEC bindings installed through your package manager.

You haven't stated which linux distribution or package manager that you're using, so I can't really help you further with that.

@Electrik-rich546456
Copy link
Author

Electrik-rich546456 commented Dec 8, 2021

Oh sorry I'm running Ubuntu 20.04.3 LTS 64bit my package manager is apt get or synaptic package manager

@trainman419
Copy link
Owner

It looks like the PulseEight CEC library is packaged as python3-cec for Ubuntu ( https://packages.ubuntu.com/focal/python/python3-cec ); you can check if that's installed with dpkg -l python3-cec

@Electrik-rich546456
Copy link
Author

oh i see... its not installed...oops {[( still a noob )}]
so in your demo code i believe you import the same cec module the demo code from pulse-eight repo.
if that is correct will installing this python3-cec mess up the demo code ? supplied in that repo?
it may be a silly question but i'm still learning everyday. sorry if it is
I hope not and understand how using your code will be a lot better/ easier less code.
But i've been tinkering with the pyCecClient.py file
I wanted to have it switch hdmi sources and check power status and obviously turn on and off after power check so a power toggle function. can i do all that using your code bindings?

@Electrik-rich546456
Copy link
Author

I still get this error ./Test.py <module '_cec' from '/home/user/Ext-Space/DONE/UB Documents/Python works/cec codes/cec3_bindings/_cec.cpython-38-x86_64-linux-gnu.so'> Traceback (most recent call last): File "./Test.py", line 6, in <module> adapters = cec.list_adapters() AttributeError: module 'cec' has no attribute 'list_adapters' when running your test script

@Electrik-rich546456
Copy link
Author

./pyCecClient.py <module '_cec' from '/home/user/Ext-Space/DONE/UB Documents/Python works/cec codes/cec3_bindings/_cec.cpython-38-x86_64-linux-gnu.so'> <module 'cec' from '/home/user/Ext-Space/DONE/UB Documents/Python works/cec codes/cec3_bindings/cec.py'> libCEC version 4.0.4 loaded: git revision: libcec-4.0.4+1-ba9b538~dirty, compiled on Wed 12 Feb 13:45:05 UTC 2020 by user@user-pc on Linux 5.3.0-29-generic (x86_64), features: P8_USB, DRM, P8_detect, randr

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