-
Notifications
You must be signed in to change notification settings - Fork 475
Installation
- Introduction
- macOS
- Linux (Ubuntu/Raspberry Pi OS)
- Windows (64-bit)
- Starting PyBoy
- Building from Source
It should be noted that the emulator is still under development. Even though games might work flawlessly now, be warned that saved games may be lost without any notice.
Note: If you have any problems, please feel free to let us know or ask for help on Discord! We try our best to keep the instructions up-to-date, but if something seems wrong or outdated please let us know.
The easiest way to get started is to first install brew.
When brew is installed, install Python 3 with the following commands in the terminal. Open a terminal and type in the following, line by line:
> brew update
> brew install python3
Now, you can simply install from PyPi:
> python3 -m pip install --upgrade pip
> python3 -m pip install pyboy
Note: If pip
tries to build Pillow from source, you may get an error. brew install jpeg
seems to fix this.
You're now ready to play some games! Continue to Starting PyBoy.
Ubuntu's system version of Python is Python 2.7, so you can install the requirements for Python 3 without messing anything up. Open a terminal and type in the following, line by line:
> sudo apt update
> sudo apt install python3 python3-pip
Thanks to the piwheels project, ARM-compatible wheels of PyBoy are available at https://www.piwheels.org/project/pyboy/, and by default pip3
will use these wheels on Raspberry Pi OS (if not, check /etc/pip.conf
or see https://www.piwheels.org/faq.html).
Now, you can simply install from PyPi:
> python3 -m pip install --upgrade pip
> python3 -m pip install pyboy
You're now ready to play some games! Continue to Starting PyBoy.
First of you need to install Python 3. Follow the link "Latest Python 3 Release - Python 3.x.x", and install it: Python 3. At the time of writing, this is 3.10.8.
Open a PowerShell and simply install from PyPi:
> py -m pip install --upgrade pip
> py -m pip install pyboy
You're now ready to play some games! Continue to Starting PyBoy.
If you have to build from source, you will need to install the "Visual Studio Build Tools" with the "C++ build tools".
The installer can be found at https://visualstudio.microsoft.com/downloads/ under "Tools for Visual Studio 2019." When run, it will install a program onto your computer called "Visual Studio Installer" that allows you to install or uninstall various components of Visual Studio. Run it and make sure to check the box for "C++ build tools."
Now, find your ROM dumps, which you of course dumped yourself with PyBoyCartridge.
Then run python3 -m pyboy path/to/rom.gb
from the root directory of the PyBoy Git repo. If you chose to install PyBoy on your system, you can do pyboy path/to/rom.gb
from any directory.
For more advanced use, you can use python3 -m pyboy --help
to find available options. For example: python3 -m pyboy -w SDL2 ROMs/game.rom
. See more in the section experimental features.
The Game Boy controls are as follows:
Keyboard key | GameBoy equivalant |
---|---|
Up | Up |
Down | Down |
Left | Left |
Right | Right |
A | A |
S | B |
Return | Start |
Backspace | Select |
The other controls for the emulator:
Keyboard key | Emulator function |
---|---|
Escape | Quit |
D | Debug |
Space | Unlimited FPS |
Z | Save state |
X | Load state |
I | Toggle screen recording |
, | Rewind backwards |
. | Rewind forward |
To enable rewind, see more in the section experimental features.
If you want to build from source, follow the instructions above for your platform, but don't do pip install pyboy
. If PyBoy is already installed, make sure to uninstall it with pip uninstall pyboy
. Run the uninstall more than once, to make sure you don't have multiple versions installed.
Then type the following lines in your terminal.
> python3 -m pip install -r requirements.txt
> python3 setup.py build_ext --inplace
You can also install PyBoy as a package on your system, so you can include it in other projects using:
> python3 -m pip install .
If pyboy is running slowly after the line above, make sure to navigate to a different directory than the PyBoy source code. Your system might select the non-compiled version of pyboy
in the directory over the compiled version installed on the system.