bkbilly / lnxlink

🖥 Effortlessly manage your Linux machine using MQTT.

Home Page:https://bkbilly.gitbook.io/lnxlink

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Installation on Raspbian using script

bassicrob opened this issue · comments

What type of installation are you running?

Desktop

Which Linux OS are you using?

Raspbian Bullseye

Which version of LNXLink has the issue?

2024.03.0

The problem

From a remote terminal, I run the bash script on the GitBook documentation and the installation does not complete. There is no systemd service started or setup and any lnxlink commands result in command not found. Using the installation instructions on the Github readme, pipx install, I get a metadata failure and same result, installation fails. I just upgraded the system from Buster thinking that might be the issue.

Logs

Reading state information... Done
portaudio19-dev is already the newest version (19.6.0-1.1).
python3-pyaudio is already the newest version (0.2.11-1.3+b1).
upower is already the newest version (0.99.11-2).
xdg-utils is already the newest version (1.1.3-4.1).
xdotool is already the newest version (1:3.20160805.1-4).
libasound2-dev is already the newest version (1.2.4-1.1+rpt2).
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
W: --force-yes is deprecated, use one of the options starting with --allow instead.
Upgrading LNXlink...
Traceback (most recent call last):
  File "/usr/bin/pipx", line 11, in <module>
    load_entry_point('pipx==0.12.3.1', 'console_scripts', 'pipx')()
  File "/usr/lib/python3/dist-packages/pipx/main.py", line 496, in cli
    exit(run_pipx_command(parsed_pipx_args, binary_args))
  File "/usr/lib/python3/dist-packages/pipx/main.py", line 177, in run_pipx_command
    commands.upgrade(
  File "/usr/lib/python3/dist-packages/pipx/commands.py", line 211, in upgrade
    old_version = venv.get_venv_metadata_for_package(package).package_version
  File "/usr/lib/python3/dist-packages/pipx/Venv.py", line 65, in get_venv_metadata_for_package
    data = json.loads(
  File "/usr/lib/python3.9/json/__init__.py", line 359, in loads
    return cls(**kw).decode(s)
TypeError: __init__() got an unexpected keyword argument 'encoding'

You could try running this command before running the installation script:

pip install -U pipx

EDIT: I've added this on the installation script, so you just need to run it again.

It seemed the error for me was perhaps due to the latest version of pip (20.3.4)? From the docs here, I had to run:

curl -sSL https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py pip==20.1.1

and then reinstall from the script resulted in:

libdbus-glib-1-dev is already the newest version (0.110-6).
libgirepository1.0-dev is already the newest version (1.66.1-1+b1).
libglib2.0-dev is already the newest version (2.66.8-1+deb11u1).
patchelf is already the newest version (0.12-1).
libcairo2-dev is already the newest version (1.16.0-5+rpt1).
meson is already the newest version (1.0.0-1.1~bpo11+1~rpt1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
W: --force-yes is deprecated, use one of the options starting with --allow instead.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
portaudio19-dev is already the newest version (19.6.0-1.1).
python3-pyaudio is already the newest version (0.2.11-1.3+b1).
upower is already the newest version (0.99.11-2).
xdg-utils is already the newest version (1.1.3-4.1).
xdotool is already the newest version (1:3.20160805.1-4).
libasound2-dev is already the newest version (1.2.4-1.1+rpt2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
W: --force-yes is deprecated, use one of the options starting with --allow instead.
Installing LNXlink...
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already up-to-date: pipx in ./.local/lib/python3.9/site-packages (1.4.3)
Requirement already satisfied, skipping upgrade: tomli; python_version < "3.11" in ./.local/lib/python3.9/site-packages (from pipx) (2.0.1)
Requirement already satisfied, skipping upgrade: argcomplete>=1.9.4 in ./.local/lib/python3.9/site-packages (from pipx) (3.2.3)
Requirement already satisfied, skipping upgrade: userpath!=1.9.0,>=1.6 in ./.local/lib/python3.9/site-packages (from pipx) (1.9.2)
Requirement already satisfied, skipping upgrade: packaging>=20 in ./.local/lib/python3.9/site-packages (from pipx) (23.2)
Requirement already satisfied, skipping upgrade: platformdirs>=2.1 in ./.local/lib/python3.9/site-packages (from pipx) (4.2.0)
Requirement already satisfied, skipping upgrade: click in /usr/lib/python3/dist-packages (from userpath!=1.9.0,>=1.6->pipx) (7.1.2)
WARNING: You are using pip version 20.1.1; however, version 20.3.4 is available.
You should consider upgrading via the '/usr/bin/python -m pip install --upgrade pip' command.
  installed package lnxlink 2024.3.0, installed using Python 3.9.2
  These apps are now globally available
    - lnxlink
done! ✨ 🌟 ✨
INFO:lnxlink:Config file not found.
INFO:lnxlink:Created new template: /home/pi/config.yaml
INFO:lnxlink:
Leave empty for default
 Enable MQTT automatic discovery (True/False) [True]:  MQTT server [192.168.1.1]:  MQTT port [1883]: Traceback (most recent call last):
  File "/home/pi/.local/bin/lnxlink", line 8, in <module>
    sys.exit(main())
  File "/home/pi/.local/pipx/venvs/lnxlink/lib/python3.9/site-packages/lnxlink/__main__.py", line 514, in main
    config_setup.setup_config(config_file)
  File "/home/pi/.local/pipx/venvs/lnxlink/lib/python3.9/site-packages/lnxlink/config_setup.py", line 29, in setup_config
    userprompt_config(config_path)
  File "/home/pi/.local/pipx/venvs/lnxlink/lib/python3.9/site-packages/lnxlink/config_setup.py", line 136, in userprompt_config
    config["mqtt"]["port"] = int(config["mqtt"]["port"])
ValueError: invalid literal for int() with base 10: 'echo -e "\\e[35m\\n\\n\\nAll done!\\e[0m"'

I then ran lnxlink -c linxlink.yaml and that got things running! Hope this helps somebody! 🍻

With the change I've made on the install script the issue should be fixed.