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

Raspberry pi 4 - python #106

Closed
ArashiCZ opened this issue Sep 26, 2023 · 14 comments
Closed

Raspberry pi 4 - python #106

ArashiCZ opened this issue Sep 26, 2023 · 14 comments

Comments

@ArashiCZ
Copy link

Hello.

I'm running 64bit raspios lite.
I tried to use pip3 install usbrelay-py, however i'm constantly getting this error:

`
sudo pip3 install usbrelay-py
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting usbrelay-py
Using cached usbrelay_py-1.0.tar.gz (4.1 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 /tmp/tmp60x1dyl7_in_process.py get_requires_for_build_wheel /tmp/tmpkxq_s836
cwd: /tmp/pip-install-erk9tjr_/usbrelay-py_039f083e8680440686396df0d7a080d8
Complete output (15 lines):
Traceback (most recent call last):
File "/tmp/tmp60x1dyl7_in_process.py", line 280, in
main()
File "/tmp/tmp60x1dyl7_in_process.py", line 263, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/tmp/tmp60x1dyl7_in_process.py", line 114, in get_requires_for_build_wheel
return hook(config_settings)
File "/usr/local/lib/python3.9/dist-packages/setuptools/build_meta.py", line 355, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
File "/usr/local/lib/python3.9/dist-packages/setuptools/build_meta.py", line 325, in _get_build_requires
self.run_setup()
File "/usr/local/lib/python3.9/dist-packages/setuptools/build_meta.py", line 341, in run_setup
exec(code, locals())
File "", line 17, in
ImportError: cannot import name 'setuptools' from 'setuptools' (/usr/local/lib/python3.9/dist-packages/setuptools/init.py)

WARNING: Discarding https://files.pythonhosted.org/packages/0c/ad/4036a83246a7f7e59919323fd4d1f589284b9afe539fe33c0a8036bd12f2/usbrelay_py-1.0.tar.gz#sha256=d0c74c358132ce1055487ebd6ad59bb84209d8417d670ff9d61c798eb8b783d1 (from https://pypi.org/simple/usbrelay-py/). Command errored out with exit status 1: /usr/bin/python3 /tmp/tmp60x1dyl7_in_process.py get_requires_for_build_wheel /tmp/tmpkxq_s836 Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement usbrelay-py
ERROR: No matching distribution found for usbrelay-py
`
Tried to reinstall setuptools, update pip, few other things and nothing.

@wentasah
Copy link
Contributor

Cannot you just apt install python3-usbrelay?

@darrylb123
Copy link
Owner

darrylb123 commented Sep 26, 2023 via email

@ArashiCZ
Copy link
Author

Cannot you just apt install python3-usbrelay?

Apparently not.
image

@ArashiCZ
Copy link
Author

Don't use pip. It's a binary library and is dependent on another binary library. Use the GitHub source to build and install it.

On Wed, Sep 27, 2023, 2:41 AM ArashiCZ @.> wrote: Hello. I'm running 64bit raspios lite. I tried to use pip3 install usbrelay-py, however i'm constantly getting this error: sudo pip3 install usbrelay-py Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Collecting usbrelay-py Using cached usbrelay_py-1.0.tar.gz (4.1 kB) Installing build dependencies ... done Getting requirements to build wheel ... error ERROR: Command errored out with exit status 1: command: /usr/bin/python3 /tmp/tmp60x1dyl7_in_process.py get_requires_for_build_wheel /tmp/tmpkxq_s836 cwd: /tmp/pip-install-erk9tjr_/usbrelay-py_039f083e8680440686396df0d7a080d8 Complete output (15 lines): Traceback (most recent call last): File "/tmp/tmp60x1dyl7_in_process.py", line 280, in main() File "/tmp/tmp60x1dyl7_in_process.py", line 263, in main json_out['return_val'] = hook(**hook_input['kwargs']) File "/tmp/tmp60x1dyl7_in_process.py", line 114, in get_requires_for_build_wheel return hook(config_settings) File "/usr/local/lib/python3.9/dist-packages/setuptools/build_meta.py", line 355, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=['wheel']) File "/usr/local/lib/python3.9/dist-packages/setuptools/build_meta.py", line 325, in _get_build_requires self.run_setup() File "/usr/local/lib/python3.9/dist-packages/setuptools/build_meta.py", line 341, in run_setup exec(code, locals()) File "", line 17, in ImportError: cannot import name 'setuptools' from 'setuptools' (/usr/local/lib/python3.9/dist-packages/setuptools/*init*.py) WARNING: Discarding https://files.pythonhosted.org/packages/0c/ad/4036a83246a7f7e59919323fd4d1f589284b9afe539fe33c0a8036bd12f2/usbrelay_py-1.0.tar.gz#sha256=d0c74c358132ce1055487ebd6ad59bb84209d8417d670ff9d61c798eb8b783d1 (from https://pypi.org/simple/usbrelay-py/). Command errored out with exit status 1: /usr/bin/python3 /tmp/tmp60x1dyl7_in_process.py get_requires_for_build_wheel /tmp/tmpkxq_s836 Check the logs for full command output. ERROR: Could not find a version that satisfies the requirement usbrelay-py ERROR: No matching distribution found for usbrelay-py Tried to reinstall setuptools, update pip, few other things and nothing. — Reply to this email directly, view it on GitHub <#106>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTSUVJI5E3TSQMRVSQ3FDDX4MATRANCNFSM6AAAAAA5IAT3UQ . You are receiving this because you are subscribed to this thread.Message ID: @.>

This is what i get when running the "make" command inside the folder usbrelay_py.

pi@juhu:~/python_tests/usbrelay/usbrelay-master/usbrelay_py $ make
make: *** No rule to make target '../libusbrelay.so.1.1', needed by 'all'.  Stop.

@darrylb123
Copy link
Owner

darrylb123 commented Sep 27, 2023 via email

@mefuller
Copy link
Contributor

The Fedora package is fully up-to-date!

@darrylb123
Copy link
Owner

darrylb123 commented Sep 27, 2023 via email

@darrylb123
Copy link
Owner

darrylb123 commented Sep 27, 2023 via email

@ArashiCZ
Copy link
Author

I tried to use atleast the "Sudo usbrelay" that i installed with apt, which works perfectly by the way with "| sed" and locating lines (relay) after the line with "Number of Relays" but it behaves strangly. It doesn't catch the line with the serial numbers.

I would like to avoid this by using the python extension.
Would someone help me a guide me how to build the library for python.
I'm planing to use it my upcoming project that is build upon these usb relays (home automation),
is it possible to just copy the library after building it to differnt pi ? (same hw).

Thank you.

@mefuller
Copy link
Contributor

@darrylb123 I did see your message, which is why v1.2.1 is in Rawhide, and within a couple days of clearing testing on F39 - F37: https://src.fedoraproject.org/rpms/usbrelay

@darrylb123
Copy link
Owner

darrylb123 commented Sep 27, 2023 via email

@ArashiCZ
Copy link
Author

The documentation to build usbrelay and python extension is in the readme on GitHub. If you installed the package, you should be able to check the manual page. Also, the option flags are output with the -h flag: $ usbrelay -h usbrelay: invalid option -- 'h' Try usbrelay --help' or usbrelay --usage' for more information. @.*** ~]$ usbrelay --help Usage: usbrelay [OPTION...] [ACTION...] Control or query USB HID relays. -d, --debug Produce debugging output -e, --export-id=DEV Print relay ID of the given DEV (/dev/hidrawXX) in udev-compatible format -q, --quiet Be quiet -?, --help Give this help list --usage Give a short usage message -V, --version Print program version Mandatory or optional arguments to long options are also mandatory or optional for any corresponding short options. Without ACTION, the actual state of all relays is printed to stdout. ACTION can be one of: RELID_N=[0|1] to switch the N-th relay off or on RELID_0=NEWID to change relay ID Report bugs to https://github.com/darrylb123/usbrelay/issues.

On Wed, Sep 27, 2023, 4:31 PM ArashiCZ @.> wrote: I tried to use atleast the "Sudo usbrelay" that i installed with apt, which works perfectly by the way with "| sed" and locating lines (relay) after the line with "Number of Relays" but it behaves strangly. It doesn't catch the line with the serial numbers. I would like to avoid this by using the python extension. Would someone help me a guide me how to build the library for python. I'm planing to use it my upcoming project that is build upon these usb relays (home automation), is it possible to just copy the library after building it to differnt pi ? (same hw). Thank you. — Reply to this email directly, view it on GitHub <#106 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTSUVM2NQVCTMEDKONTSEDX4PB5BANCNFSM6AAAAAA5IAT3UQ . You are receiving this because you commented.Message ID: @.>

Yes, I looked at the help, but as i posted before, I cannot build the library according to the instructions.
pi@juhu:~/python_tests/usbrelay/usbrelay-master/usbrelay_py $ make make: *** No rule to make target '../libusbrelay.so.1.1', needed by 'all'. Stop.

@darrylb123
Copy link
Owner

darrylb123 commented Sep 27, 2023 via email

@ArashiCZ
Copy link
Author

You have to build the main library first. Run make in the top level directory first then sudo make install, then cd to usbrelay_py and run make and sudo make install.

On Wed, Sep 27, 2023 at 5:13 PM ArashiCZ @.> wrote: The documentation to build usbrelay and python extension is in the readme on GitHub. If you installed the package, you should be able to check the manual page. Also, the option flags are output with the -h flag: $ usbrelay -h usbrelay: invalid option -- 'h' Try usbrelay --help' or usbrelay --usage' for more information. @. ]$ usbrelay --help Usage: usbrelay [OPTION...] [ACTION...] Control or query USB HID relays. -d, --debug Produce debugging output -e, --export-id=DEV Print relay ID of the given DEV (/dev/hidrawXX) in udev-compatible format -q, --quiet Be quiet -?, --help Give this help list --usage Give a short usage message -V, --version Print program version Mandatory or optional arguments to long options are also mandatory or optional for any corresponding short options. Without ACTION, the actual state of all relays is printed to stdout. ACTION can be one of: RELID_N=[0|1] to switch the N-th relay off or on RELID_0=NEWID to change relay ID Report bugs to https://github.com/darrylb123/usbrelay/issues. … <#m_1245572597775667863_> On Wed, Sep 27, 2023, 4:31 PM ArashiCZ @.> wrote: I tried to use atleast the "Sudo usbrelay" that i installed with apt, which works perfectly by the way with "| sed" and locating lines (relay) after the line with "Number of Relays" but it behaves strangly. It doesn't catch the line with the serial numbers. I would like to avoid this by using the python extension. Would someone help me a guide me how to build the library for python. I'm planing to use it my upcoming project that is build upon these usb relays (home automation), is it possible to just copy the library after building it to differnt pi ? (same hw). Thank you. — Reply to this email directly, view it on GitHub <#106 (comment) <#106 (comment)>>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTSUVM2NQVCTMEDKONTSEDX4PB5BANCNFSM6AAAAAA5IAT3UQ https://github.com/notifications/unsubscribe-auth/ABTSUVM2NQVCTMEDKONTSEDX4PB5BANCNFSM6AAAAAA5IAT3UQ . You are receiving this because you commented.Message ID: @.> Yes, I looked at the help, but as i posted before, I cannot build the library according to the instructions. @.***:/python_tests/usbrelay/usbrelay-master/usbrelay_py $ make make: *** No rule to make target '../libusbrelay.so.1.1', needed by 'all'. Stop. — Reply to this email directly, view it on GitHub <#106 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTSUVIL6KB7UBZS4OYRMXDX4PGZXANCNFSM6AAAAAA5IAT3UQ . You are receiving this because you were mentioned.Message ID: @.***>

Oh, I'm sorry @darrylb123 . That totaly went over my head,
Will do that asap and let you know.

Thank you.

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

4 participants