Brikwerk / nxbt

Control your Nintendo Switch through a website, terminal, or macro.
MIT License
809 stars 97 forks source link

Installation does not work, needs better install instructions. #159

Open LXTKay opened 1 month ago

LXTKay commented 1 month ago

Operating System: Kubuntu 24.04 KDE Plasma Version: 5.27.11 KDE Frameworks Version: 5.115.0 Qt Version: 5.15.13 Kernel Version: 6.8.0-40-generic (64-bit) Graphics Platform: X11 Processors: 4 × Intel® Pentium® Silver N6000 @ 1.10GHz Memory: 7,6 GiB of RAM Graphics Processor: Mesa Intel® UHD Graphics Manufacturer: Acer Product Name: Swift SF114-34 System Version: V1.14

I'm having only problems and errors following the install instructions. I have python3 version Python 3.12.3 pip version 24.

When i use the install command in the readme, i get the following error:

~$ sudo pip3 install nxbt
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.

    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.

    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.

    See /usr/share/doc/python3.12/README.venv for more information.

So installed virtualenv

~$ sudo apt install python3-virtualenv
~$virtualenv .
~$source ./bin/activate

Then i tried to install the initial package again: (TAS) x@x:~/TAS$ pip3 install nxbt Which gave me an error after slowly installing for a while. It seemed related to the dbus-python package, so i ran the command from the troubleshooting section:

sudo apt-get install libdbus-glib-1-dev libdbus-1-dev Aftwerwards, when running pip3 install nxbt again, i get an ENOURMOUS 1 million lines error. The terminal is not even capable to keep the entire error message. I will copy paste the last couple lines:

      make: *** [Makefile:1627: install-recursive] Error 1
      make: Leaving directory '/tmp/pip-install-27m9__kk/dbus-python_5f087983a6bf4c2a86ee7fb1e505bfa6/build/temp.linux-x86_64-cpython-312'
      Traceback (most recent call last):
        File "/home/lxtk/TAS/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/lxtk/TAS/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/lxtk/TAS/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-ie6u9x11/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 415, in build_wheel
          return self._build_with_temp_dir(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-ie6u9x11/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 397, in _build_with_temp_dir
          self.run_setup()
        File "/tmp/pip-build-env-ie6u9x11/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 497, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-ie6u9x11/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 313, in run_setup
          exec(code, locals())
        File "<string>", line 85, in <module>
        File "/tmp/pip-build-env-ie6u9x11/overlay/lib/python3.12/site-packages/setuptools/__init__.py", line 108, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-ie6u9x11/overlay/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 184, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-ie6u9x11/overlay/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 200, in run_commands
          dist.run_commands()
        File "/tmp/pip-build-env-ie6u9x11/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 964, in run_commands
          self.run_command(cmd)
        File "/tmp/pip-build-env-ie6u9x11/overlay/lib/python3.12/site-packages/setuptools/dist.py", line 945, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-ie6u9x11/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 983, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-ie6u9x11/overlay/lib/python3.12/site-packages/setuptools/command/bdist_wheel.py", line 373, in run
          self.run_command("build")
        File "/tmp/pip-build-env-ie6u9x11/overlay/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-ie6u9x11/overlay/lib/python3.12/site-packages/setuptools/dist.py", line 945, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-ie6u9x11/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 983, in run_command
          cmd_obj.run()
        File "<string>", line 70, in run
        File "/usr/lib/python3.12/subprocess.py", line 413, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['make', '-C', '/tmp/pip-install-27m9__kk/dbus-python_5f087983a6bf4c2a86ee7fb1e505bfa6/build/temp.linux-x86_64-cpython-312', 'install', 'pythondir=/tmp/pip-install-27m9__kk/dbus-python_5f087983a6bf4c2a86ee7fb1e505bfa6/build/lib.linux-x86_64-cpython-312', 'pyexecdir=/tmp/pip-install-27m9__kk/dbus-python_5f087983a6bf4c2a86ee7fb1e505bfa6/build/lib.linux-x86_64-cpython-312']' returned non-zero exit status 2.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for dbus-python
Failed to build dbus-python
ERROR: Could not build wheels for dbus-python, which is required to install pyproject.toml-based projects

Running the testfile afterwards was not successful:

(TAS) x@x:~/TAS$ nxbt webapp
nxbt: command not found
(TAS) x@x:~/TAS$ sudo nxbt webapp
[sudo] password for x: 
sudo: nxbt: command not found
RPGillespie6 commented 2 days ago

Yeah this is one of the many unfortunate consequences of using python. I suspect it's because you are on too new of a python version (3.12). Python 3.12 doesn't appear to work for this repo because it removed imp. You'll either have to downgrade to 3.11 or just clone the repo and don't try to install nxbt using pip.