Brikwerk / nxbt

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

Can't properly install NXBT #155

Open FuhKonami opened 6 months ago

FuhKonami commented 6 months ago

When I try to install NXBT on my Raspberry Pi 5, it gives me the following:

image

And when I include the flag "--break-system-packages", it gives me the following errors:

username@raspberrypi:~ $ sudo pip3 install nxbt --break-system-packages Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Collecting nxbt Using cached https://www.piwheels.org/simple/nxbt/nxbt-0.1.4-py3-none-any.whl (104 kB) Collecting dbus-python==1.2.16 Using cached dbus-python-1.2.16.tar.gz (576 kB) Preparing metadata (setup.py) ... done Collecting Flask==1.1.2 Using cached https://www.piwheels.org/simple/flask/Flask-1.1.2-py2.py3-none-any.whl (94 kB) Collecting Flask-SocketIO==5.0.1 Using cached https://www.piwheels.org/simple/flask-socketio/Flask_SocketIO-5.0.1-py2.py3-none-any.whl (16 kB) Collecting eventlet==0.31.0 Using cached https://www.piwheels.org/simple/eventlet/eventlet-0.31.0-py2.py3-none-any.whl (224 kB) Collecting blessed==1.17.10 Using cached https://www.piwheels.org/simple/blessed/blessed-1.17.10-py2.py3-none-any.whl (76 kB) Collecting pynput==1.7.1 Using cached https://www.piwheels.org/simple/pynput/pynput-1.7.1-py2.py3-none-any.whl (99 kB) Collecting psutil==5.6.6 Using cached psutil-5.6.6-cp311-cp311-linux_aarch64.whl Collecting cryptography==3.3.2 Using cached cryptography-3.3.2-cp36-abi3-manylinux2014_aarch64.whl (2.6 MB) Requirement already satisfied: wcwidth>=0.1.4 in /usr/local/lib/python3.11/dist-packages (from blessed==1.17.10->nxbt) (0.2.13) Requirement already satisfied: six>=1.9.0 in /usr/lib/python3/dist-packages (from blessed==1.17.10->nxbt) (1.16.0) Collecting cffi>=1.12 Using cached cffi-1.16.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (466 kB) Collecting dnspython<2.0.0,>=1.15.0 Using cached https://www.piwheels.org/simple/dnspython/dnspython-1.16.0-py2.py3-none-any.whl (188 kB) Collecting greenlet>=0.3 Using cached greenlet-3.0.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (657 kB) Requirement already satisfied: Werkzeug>=0.15 in /usr/lib/python3/dist-packages (from Flask==1.1.2->nxbt) (2.2.2) Requirement already satisfied: Jinja2>=2.10.1 in /usr/lib/python3/dist-packages (from Flask==1.1.2->nxbt) (3.1.2) Requirement already satisfied: itsdangerous>=0.24 in /usr/lib/python3/dist-packages (from Flask==1.1.2->nxbt) (2.1.2) Requirement already satisfied: click>=5.1 in /usr/lib/python3/dist-packages (from Flask==1.1.2->nxbt) (8.1.3) Collecting python-socketio>=5.0.2 Using cached https://www.piwheels.org/simple/python-socketio/python_socketio-5.11.2-py3-none-any.whl (75 kB) Collecting evdev>=1.3 Using cached evdev-1.7.1-cp311-cp311-linux_aarch64.whl Collecting python-xlib>=0.17 Using cached https://www.piwheels.org/simple/python-xlib/python_xlib-0.33-py2.py3-none-any.whl (182 kB) Collecting pycparser Using cached https://www.piwheels.org/simple/pycparser/pycparser-2.22-py3-none-any.whl (117 kB) Collecting bidict>=0.21.0 Using cached https://www.piwheels.org/simple/bidict/bidict-0.23.1-py3-none-any.whl (32 kB) Collecting python-engineio>=4.8.0 Using cached https://www.piwheels.org/simple/python-engineio/python_engineio-4.9.0-py3-none-any.whl (57 kB) Collecting simple-websocket>=0.10.0 Using cached https://www.piwheels.org/simple/simple-websocket/simple_websocket-1.0.0-py3-none-any.whl (13 kB) Collecting wsproto Using cached https://www.piwheels.org/simple/wsproto/wsproto-1.2.0-py3-none-any.whl (24 kB) Collecting h11<1,>=0.9.0 Using cached https://www.piwheels.org/simple/h11/h11-0.14.0-py3-none-any.whl (58 kB) Building wheels for collected packages: dbus-python Building wheel for dbus-python (setup.py) ... error error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [153 lines of output] running bdist_wheel running build creating /tmp/pip-install-gqc13066/dbus-python_0b023709ed1c4286967571232fa66035/build creating /tmp/pip-install-gqc13066/dbus-python_0b023709ed1c4286967571232fa66035/build/temp.linux-aarch64-cpython-311 checking whether make supports nested variables... yes checking whether to enable maintainer-specific portions of Makefiles... no checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking whether gcc understands -c and -o together... yes checking how to run the C preprocessor... gcc -E checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking minix/config.h usability... no checking minix/config.h presence... no checking for minix/config.h... no checking whether it is safe to define EXTENSIONS... yes checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /usr/bin/mkdir -p checking for gawk... no checking for mawk... mawk checking whether make sets $(MAKE)... yes checking whether make supports the include directive... yes (GNU style) checking whether UID '0' is supported by ustar format... yes checking whether GID '0' is supported by ustar format... yes checking how to create a ustar tar archive... gnutar checking dependency style of gcc... gcc3 checking build system type... aarch64-unknown-linux-gnu checking host system type... aarch64-unknown-linux-gnu checking for native Windows host... no checking how to print strings... printf checking for a sed that does not truncate output... /usr/bin/sed checking for fgrep... /usr/bin/grep -F checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B checking the name lister (/usr/bin/nm -B) interface... BSD nm checking whether ln -s works... yes checking the maximum length of command line arguments... 1572864 checking how to convert aarch64-unknown-linux-gnu file names to aarch64-unknown-linux-gnu format... func_convert_file_noop checking how to convert aarch64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop checking for /usr/bin/ld option to reload object files... -r checking for objdump... objdump checking how to recognize dependent libraries... pass_all checking for dlltool... no checking how to associate runtime and link libraries... printf %s\n checking for ar... ar checking for archiver @FILE support... @ checking for strip... strip checking for ranlib... ranlib checking command to parse /usr/bin/nm -B output from gcc object... ok checking for sysroot... no checking for a working dd... /usr/bin/dd checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1 checking for mt... mt checking if mt is a manifest tool... no checking for dlfcn.h... yes checking for objdir... .libs checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC -DPIC checking if gcc PIC flag -fPIC -DPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.o... (cached) yes checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking for inline... inline checking for gawk... (cached) mawk checking for python... /usr/bin/python3 checking for a version of Python >= '2.1.0'... yes checking for a version of Python >= '2.7'... yes checking for the distutils Python package... yes checking for Python include path... -I/usr/include/python3.11 checking for Python library path... -L/usr/lib/aarch64-linux-gnu -lpython3.11 checking for Python site-packages path... /usr/lib/python3/dist-packages checking python extra libraries... -ldl -lm checking python extra linking flags... -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions checking consistency of all components of python development environment... yes checking for python version... 3.1 checking for python platform... linux checking for python script directory... ${prefix}/local/lib/python3.11/dist-packages checking for python extension module directory... ${exec_prefix}/local/lib/python3.11/dist-packages checking python3 module: sphinx... no checking python3 module: sphinx_rtd_theme... no checking for dbus-run-session... /usr/bin/dbus-run-session checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for DBUS... no configure: error: Package requirements (dbus-1 >= 1.8) were not met:

  Package 'dbus-1', required by 'virtual:world', not found

  Consider adjusting the PKG_CONFIG_PATH environment variable if you
  installed software in a non-standard prefix.

  Alternatively, you may set the environment variables DBUS_CFLAGS
  and DBUS_LIBS to avoid the need to call pkg-config.
  See the pkg-config man page for more details.
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/tmp/pip-install-gqc13066/dbus-python_0b023709ed1c4286967571232fa66035/setup.py", line 85, in <module>
      setup(
    File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 108, in setup
      return distutils.core.setup(**attrs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 185, in setup
      return run_commands(dist)
             ^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 201, in run_commands
      dist.run_commands()
    File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 969, in run_commands
      self.run_command(cmd)
    File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 1213, in run_command
      super().run_command(command)
    File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/usr/lib/python3/dist-packages/wheel/bdist_wheel.py", line 325, in run
      self.run_command("build")
    File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 318, in run_command
      self.distribution.run_command(command)
    File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 1213, in run_command
      super().run_command(command)
    File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/tmp/pip-install-gqc13066/dbus-python_0b023709ed1c4286967571232fa66035/setup.py", line 56, in run
      subprocess.check_call([
    File "/usr/lib/python3.11/subprocess.py", line 413, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['/tmp/pip-install-gqc13066/dbus-python_0b023709ed1c4286967571232fa66035/configure', '--disable-maintainer-mode', 'PYTHON=/usr/bin/python3', '--prefix=/tmp/pip-install-gqc13066/dbus-python_0b023709ed1c4286967571232fa66035/build/temp.linux-aarch64-cpython-311/prefix']' returned non-zero exit status 1.
  [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 Running setup.py clean for dbus-python Failed to build dbus-python Installing collected packages: dbus-python, python-xlib, pycparser, psutil, h11, greenlet, Flask, evdev, dnspython, blessed, bidict, wsproto, pynput, eventlet, cffi, simple-websocket, cryptography, python-engineio, python-socketio, Flask-SocketIO, nxbt Attempting uninstall: dbus-python Found existing installation: dbus-python 1.3.2 Not uninstalling dbus-python at /usr/lib/python3/dist-packages, outside environment /usr Can't uninstall 'dbus-python'. No files were found to uninstall. Running setup.py install for dbus-python ... error error: subprocess-exited-with-error

× Running setup.py install for dbus-python did not run successfully. │ exit code: 1 ╰─> [158 lines of output] running install /usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( running build creating /tmp/pip-install-gqc13066/dbus-python_0b023709ed1c4286967571232fa66035/build creating /tmp/pip-install-gqc13066/dbus-python_0b023709ed1c4286967571232fa66035/build/temp.linux-aarch64-cpython-311 checking whether make supports nested variables... yes checking whether to enable maintainer-specific portions of Makefiles... no checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking whether gcc understands -c and -o together... yes checking how to run the C preprocessor... gcc -E checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking minix/config.h usability... no checking minix/config.h presence... no checking for minix/config.h... no checking whether it is safe to define EXTENSIONS... yes checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /usr/bin/mkdir -p checking for gawk... no checking for mawk... mawk checking whether make sets $(MAKE)... yes checking whether make supports the include directive... yes (GNU style) checking whether UID '0' is supported by ustar format... yes checking whether GID '0' is supported by ustar format... yes checking how to create a ustar tar archive... gnutar checking dependency style of gcc... gcc3 checking build system type... aarch64-unknown-linux-gnu checking host system type... aarch64-unknown-linux-gnu checking for native Windows host... no checking how to print strings... printf checking for a sed that does not truncate output... /usr/bin/sed checking for fgrep... /usr/bin/grep -F checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B checking the name lister (/usr/bin/nm -B) interface... BSD nm checking whether ln -s works... yes checking the maximum length of command line arguments... 1572864 checking how to convert aarch64-unknown-linux-gnu file names to aarch64-unknown-linux-gnu format... func_convert_file_noop checking how to convert aarch64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop checking for /usr/bin/ld option to reload object files... -r checking for objdump... objdump checking how to recognize dependent libraries... pass_all checking for dlltool... no checking how to associate runtime and link libraries... printf %s\n checking for ar... ar checking for archiver @FILE support... @ checking for strip... strip checking for ranlib... ranlib checking command to parse /usr/bin/nm -B output from gcc object... ok checking for sysroot... no checking for a working dd... /usr/bin/dd checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1 checking for mt... mt checking if mt is a manifest tool... no checking for dlfcn.h... yes checking for objdir... .libs checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC -DPIC checking if gcc PIC flag -fPIC -DPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.o... (cached) yes checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking for inline... inline checking for gawk... (cached) mawk checking for python... /usr/bin/python3 checking for a version of Python >= '2.1.0'... yes checking for a version of Python >= '2.7'... yes checking for the distutils Python package... yes checking for Python include path... -I/usr/include/python3.11 checking for Python library path... -L/usr/lib/aarch64-linux-gnu -lpython3.11 checking for Python site-packages path... /usr/lib/python3/dist-packages checking python extra libraries... -ldl -lm checking python extra linking flags... -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions checking consistency of all components of python development environment... yes checking for python version... 3.1 checking for python platform... linux checking for python script directory... ${prefix}/local/lib/python3.11/dist-packages checking for python extension module directory... ${exec_prefix}/local/lib/python3.11/dist-packages checking python3 module: sphinx... no checking python3 module: sphinx_rtd_theme... no checking for dbus-run-session... /usr/bin/dbus-run-session checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for DBUS... no configure: error: Package requirements (dbus-1 >= 1.8) were not met:

  Package 'dbus-1', required by 'virtual:world', not found

  Consider adjusting the PKG_CONFIG_PATH environment variable if you
  installed software in a non-standard prefix.

  Alternatively, you may set the environment variables DBUS_CFLAGS
  and DBUS_LIBS to avoid the need to call pkg-config.
  See the pkg-config man page for more details.
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/tmp/pip-install-gqc13066/dbus-python_0b023709ed1c4286967571232fa66035/setup.py", line 85, in <module>
      setup(
    File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 108, in setup
      return distutils.core.setup(**attrs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 185, in setup
      return run_commands(dist)
             ^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 201, in run_commands
      dist.run_commands()
    File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 969, in run_commands
      self.run_command(cmd)
    File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 1213, in run_command
      super().run_command(command)
    File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/usr/lib/python3/dist-packages/setuptools/command/install.py", line 68, in run
      return orig.install.run(self)
             ^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/setuptools/_distutils/command/install.py", line 698, in run
      self.run_command('build')
    File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 318, in run_command
      self.distribution.run_command(command)
    File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 1213, in run_command
      super().run_command(command)
    File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/tmp/pip-install-gqc13066/dbus-python_0b023709ed1c4286967571232fa66035/setup.py", line 56, in run
      subprocess.check_call([
    File "/usr/lib/python3.11/subprocess.py", line 413, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['/tmp/pip-install-gqc13066/dbus-python_0b023709ed1c4286967571232fa66035/configure', '--disable-maintainer-mode', 'PYTHON=/usr/bin/python3', '--prefix=/tmp/pip-install-gqc13066/dbus-python_0b023709ed1c4286967571232fa66035/build/temp.linux-aarch64-cpython-311/prefix']' returned non-zero exit status 1.
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Can't roll back dbus-python; was not uninstalled error: legacy-install-failure

× Encountered error while trying to install package. ╰─> dbus-python

note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure.

Feror-BotMaker commented 6 months ago

I have the same issue on an Ubuntu Server VM on an Apple Silicon host. Strangely it works on an Ubuntu VM (with GUI) but since I do not need the GUI I tried to install it on Ubuntu Server.

When I try to install dbus-python on its own it works fine, but with nxbt it simply doesn't build.

Feror-BotMaker commented 6 months ago

Update: Got it to work. I installed it manually by cloning the repo and editing setup.py to change dbus-python version from 1.2.16 to latest (1.3.3).

Fackonami commented 6 months ago

Update: Got it to work. I installed it manually by cloning the repo and editing setup.py to change dbus-python version from 1.2.16 to latest (1.3.3).

I’m trying to do that myself. What commands did you use exactly?

Feror-BotMaker commented 5 months ago

git clone nano nxbt/setup.py replace the line

Fackonami commented 5 months ago

That’s not what I meant. I did that, but how do you run the setup.py? How do you manually install it from there? I tried

sudo python3 setup.py

but got an error.

kgraefe commented 5 months ago

That’s not what I meant. I did that, but how do you run the setup.py? How do you manually install it from there?

pip install .

I'd recommend creating a virtual environment first to not pollute your host: https://virtualenv.pypa.io/en/latest/user_guide.html

Fackonami commented 5 months ago

A virtual environment inside my Raspberry Pi? How? I tried changing the line and installing it manually, but it keeps giving me an error between having dbus-python 1.3.2 or 1.3.3.

kgraefe commented 5 months ago

untested: