logitech-flow-kvm icon indicating copy to clipboard operation
logitech-flow-kvm copied to clipboard

After installation I have no command listed, nor known to exists command are present

Open tiborkiss opened this issue 1 year ago • 10 comments

Exactly the functionality of this module I was looking for... I gave it a try on a Ubuntu 22.04.3 LTS .

During the installation I used a clean miniconda environment. Then I had to install the following things

sudo apt-get install libcairo2-dev
sudo apt-get install gobject-introspection
sudo apt-get install libgirepository1.0-dev

Unfortunately I cannot list devices

> logitech-flow-kvm list-devices
usage: logitech-flow-kvm [-h] {} ...
logitech-flow-kvm: error: argument command: invalid choice: 'list-devices' (choose from )

Nor any commands seems to be exposing.

> logitech-flow-kvm -h
usage: logitech-flow-kvm [-h] {} ...

positional arguments:
  {}

options:
  -h, --help  show this help message and exit

Some pretty basic problem it should be.

tiborkiss avatar Aug 04 '24 10:08 tiborkiss

I’m afraid I can only guess that this problem is somehow connected to you using miniconda 🤷. The command list is registered via setuptools entrypoints— maybe miniconda and setuptools are incompatible?

coddingtonbear avatar Aug 04 '24 14:08 coddingtonbear

Now I installed under Python 3.10.12 as it is global in my Ubuntu, without any virtual env. Usuall I am not installing anything without virtual env. Now it looks like this.

appdirs==1.4.4
apturl==0.5.2
astroid==2.9.3
Babel==2.8.0
bcrypt==3.2.0
bitstruct==8.19.0
blinker==1.8.2
Brlapi==0.8.3
Brotli==1.0.9
certifi==2020.6.20
cffi==1.16.0
chardet==4.0.0
charset-normalizer==3.3.2
click==8.1.7
colorama==0.4.4
command-not-found==0.3
commonmark==0.9.1
cryptography==38.0.4
cupshelpers==1.0
dbus-python==1.2.18
defer==1.0.6
distro==1.7.0
distro-info==1.1+ubuntu0.1
duplicity==0.8.21
ecdsa==0.18.0b1
evdev==1.6.1
fasteners==0.14.1
Flask==2.3.3
Flask-HTTPAuth==4.8.0
future==0.18.2
gitdb==4.0.9
GitPython==3.1.24
gpg===1.16.0-unknown
hid-parser==0.0.3
httplib2==0.20.2
idna==3.3
importlib-metadata==4.6.4
isort==5.6.4
itsdangerous==2.2.0
jeepney==0.7.1
Jinja2==3.1.4
keyring==23.5.0
language-selector==0.1
launchpadlib==1.10.16
lazr.restfulclient==0.14.4
lazr.uri==1.0.6
lazy-object-proxy==0.0.0
lockfile==0.12.2
logilab-common==1.8.2
logitech-flow-kvm==1.2.0
louis==3.20.0
macaroonbakery==1.3.1
Mako==1.1.3
Markdown==3.3.6
MarkupSafe==2.1.5
mccabe==0.6.1
monotonic==1.6
more-itertools==8.10.0
mutagen==1.45.1
mypy-extensions==0.4.3
netifaces==0.11.0
oauthlib==3.2.0
olefile==0.46
packaging==21.3
paramiko==2.9.3
pexpect==4.8.0
Pillow==9.0.1
platformdirs==2.5.1
protobuf==3.12.4
psutil==6.0.0
ptyprocess==0.7.0
pyaes==1.6.1
pycairo==1.20.1
pycparser==2.22
pycryptodomex==3.11.0
pycups==2.0.1
Pygments==2.11.2
PyGObject==3.42.1
PyJWT==2.3.0
pylint==2.12.2
pymacaroons==0.13.0
PyNaCl==1.5.0
pyOpenSSL==22.1.0
pyparsing==2.4.7
pyperclip==1.9.0
PyQt5==5.15.6
PyQt5-sip==12.9.1
pyRFC3339==1.1
pyserial==3.5
PySocks==1.7.1
python-apt==2.4.0+ubuntu2
python-dateutil==2.8.1
python-debian==0.1.43+ubuntu1.1
python-xlib==0.33
pytz==2022.1
pyudev==0.24.3
pyxattr==0.7.2
pyxdg==0.27
PyYAML==5.4.1
reportlab==3.6.8
requests==2.32.3
rich==12.6.0
safdie==2.0.1
SecretStorage==3.3.1
six==1.16.0
smmap==5.0.0
solaar==1.1.13
ssh-import-id==5.11
systemd-python==234
toml==0.10.2
typing-extensions==3.10.0.2
ubuntu-advantage-tools==8001
ubuntu-drivers-common==0.0.0
ufw==0.36.1
unattended-upgrades==0.1
urllib3==1.26.5
usb-creator==0.3.7
wadllib==1.3.6
websockets==9.1
Werkzeug==3.0.3
wrapt==1.13.3
xdg==5
xkit==0.0.0
yt-dlp==2022.4.8
zipp==1.0.0

The result is the same.

Maybe next week when I will have a bit of time I will look into the code and try to reproduce and debug that aspect, how the commands are handled.

tiborkiss avatar Aug 04 '24 15:08 tiborkiss

I can tell you that the subcommands use entrypoints as defined here: https://github.com/coddingtonbear/logitech-flow-kvm/blob/main/setup.py#L107 -- this is stuff that is handled automatically by stuff documented here -- https://setuptools.pypa.io/en/latest/userguide/entry_point.html. Since you're encountering this in both places, I wonder if you're just not installing the package with python setup.py install?

coddingtonbear avatar Aug 04 '24 15:08 coddingtonbear

The same with local install. I will take a look in detail in the upcoming days. This tool I really need. Just right now I am a bit too busy, but usually during the weekends I can make some free time.

tiborkiss avatar Aug 06 '24 19:08 tiborkiss

I removed from pip and installed just from python setup.py install .

The main entry point is found from "console_scripts" which is the one known by setuptool. But SafdieRunner when is trying to find "logitech_flow_kvm.commands" entries, returns nothing.

tiborkiss avatar Aug 18 '24 20:08 tiborkiss

I'm afraid I'm not sure how to help you figure out the problem with the little context I can glean from this conversation. What I can tell you, though is that this method of registering commands and using them is very common and many, many tools rely upon it -- it's definitely not something invented here! I have to assume there's something very peculiar about the environment you're running this in, but my guess offhand is that the environment into which you've installed the app via python setup.py install isn't the same one that is being launched into when you run logitech-flow-kvm.

What I'd recommend for getting yourself into a clean slate for troubleshooting is maybe creating a new, empty virtual environment (verifying that it's "clean" by making sure you can't run logitech-flow-kvm there) and trying to install the app there. Good luck!

coddingtonbear avatar Aug 18 '24 20:08 coddingtonbear

I had this exact issue and was able to resolve it. This seemed to be an issue with solaar libraries. @tiborkiss try #4 to see if it resolves this issue for you as well.

Roosta078 avatar Sep 15 '24 01:09 Roosta078

@Roosta078 's PR is perfectly working on my Ubuntu 22.04. However, the script is not working on MacOS15.1.1 and I got same situation like @tiborkiss. It's really bothering that I can't smoothly transfer from linux to macOS. If you guys have any possible solutions?

Bingqi-Huang avatar Feb 10 '25 05:02 Bingqi-Huang

To me it gets even more complicated because I had to replace my keyboard, which of course has Bolt adaptor and the mouse still has old adaptor. (Frankly I don't like the mouses which has the new Bolt adaptor, because the buttons are hidden in the bottom of the mouse.) Therefore I end up to a hardware solution for the moment (Kceve 10Gbps USB Switch 2) which by one button and 2 led indicators can switch everything I have to. Moreover, I don't really depend if the mouse or keyboard is from the same brand, Bolt or Uni...

tiborkiss avatar Feb 10 '25 06:02 tiborkiss

I had a USB KVM switch before i try to find this software solution. Acturally the most important reason i bought the mx keys keyboard is to use its key instead of the kvm switch to make my work flow more "elegent":P. anyway thanks for you reply.

Bingqi-Huang avatar Feb 10 '25 10:02 Bingqi-Huang