40Cakes / pokebot-gen3

PokéBot Gen3 is a shiny hunting bot, written in Python that runs libmgba + mGBA Python bindings under the hood. Pokémon Ruby, Sapphire, Emerald, FireRed and LeafGreen are supported.
https://www.youtube.com/@40_Cakes/streams
GNU General Public License v3.0
178 stars 54 forks source link

Support Windows on ARM #345

Closed TeamBrainStorm closed 3 months ago

TeamBrainStorm commented 3 months ago

When I run the Python script on my Surface Laptop 7, which has a Snapdragon chip in it, I get errors and the app crashes when trying to install the dependencies.

here is the log

The following Python modules need to be checked and possibly installed:

Install those modules? [y/N] y

Requirement already satisfied: confz==2.0.1 in c:\users\devs4\appdata\local\programs\python\python312-arm64\lib\site-packages (2.0.1) Requirement already satisfied: PyYAML<7.0.0,>=5.4.1 in c:\users\devs4\appdata\local\programs\python\python312-arm64\lib\site-packages (from confz==2.0.1) (6.0.1) Requirement already satisfied: pydantic<3.0.0,>=1.9.0 in c:\users\devs4\appdata\local\programs\python\python312-arm64\lib\site-packages (from confz==2.0.1) (2.7.4) Requirement already satisfied: python-dotenv<2.0.0,>=0.19.2 in c:\users\devs4\appdata\local\programs\python\python312-arm64\lib\site-packages (from confz==2.0.1) (1.0.1) Requirement already satisfied: toml<0.11.0,>=0.10.2 in c:\users\devs4\appdata\local\programs\python\python312-arm64\lib\site-packages (from confz==2.0.1) (0.10.2) Requirement already satisfied: annotated-types>=0.4.0 in c:\users\devs4\appdata\local\programs\python\python312-arm64\lib\site-packages (from pydantic<3.0.0,>=1.9.0->confz==2.0.1) (0.7.0) Requirement already satisfied: pydantic-core==2.18.4 in c:\users\devs4\appdata\local\programs\python\python312-arm64\lib\site-packages (from pydantic<3.0.0,>=1.9.0->confz==2.0.1) (2.18.4) Requirement already satisfied: typing-extensions>=4.6.1 in c:\users\devs4\appdata\local\programs\python\python312-arm64\lib\site-packages (from pydantic<3.0.0,>=1.9.0->confz==2.0.1) (4.12.2) Collecting numpy~=1.26.1 Using cached numpy-1.26.4.tar.gz (15.8 MB) Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... error error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [21 lines of output]

× Encountered error while generating package metadata. ╰─> See above for output.

note: This is an issue with the package mentioned above, not pip. hint: See above for details. Traceback (most recent call last): File "C:\Users\devs4\Documents\pokebot-20240528.0\pokebot.py", line 107, in check_requirements() File "C:\Users\devs4\Documents\pokebot-20240528.0\requirements.py", line 231, in check_requirements return update_requirements() ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\devs4\Documents\pokebot-20240528.0\requirements.py", line 113, in update_requirements subprocess.check_call( File "C:\Users\devs4\AppData\Local\Programs\Python\Python312-arm64\Lib\subprocess.py", line 413, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['C:\Users\devs4\AppData\Local\Programs\Python\Python312-arm64\python.exe', '-m', 'pip', 'install', '--disable-pip-version-check', '--no-python-version-warning', 'numpy~=1.26.1']' returned non-zero exit status 1. Exception ignored in atexit callback: <function on_exit at 0x0000022FF62C8A40> Traceback (most recent call last): File "C:\Users\devs4\Documents\pokebot-20240528.0\pokebot.py", line 24, in on_exit import psutil ModuleNotFoundError: No module named 'psutil'

thanks for everything you have done!

hanzi commented 3 months ago

Unfortunately, Windows on ARM not supported by the bot.

The error you're seeing does not even relate to the bot but to the Python package numpy which apparently also does not support Windows on ARM -- though that might be solvable with some extra work.

But even if you get numpy to run, our mGBA bindings (a vital part of the bot that does the actual emulation) is not available for that platform either. And we currently do not have the means (i.e. a Windows-on-ARM device to develop and test with) to add that support.

TeamBrainStorm commented 3 months ago

I found a solution to my issue if you have a windows copilot PC with a snapdragon CPU if you download and install the 64bit version of python the bot will work! here is the link to the installer i used: https://www.python.org/ftp/python/3.12.4/python-3.12.4-amd64.exe