Update pip install commands to use piwheels#588
Conversation
my raspberry pi zero could never finsih the install script. I waited ~16 hours. by using pywheels, it finishes in a few minutes.
There was a problem hiding this comment.
Pull request overview
This PR updates the installation script to use piwheels as an additional package index for pip installations. The change aims to significantly reduce installation time on Raspberry Pi Zero devices by using pre-built ARM wheels instead of compiling packages from source.
Changes:
- Added
--extra-index-url https://www.piwheels.org/simpleflag to all pip install commands in thecreate_venv()function in install.sh
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| $VENV_PATH/bin/python -m pip install --extra-index-url https://www.piwheels.org/simple --upgrade pip setuptools wheel > /dev/null | ||
| $VENV_PATH/bin/python -m pip install --extra-index-url https://www.piwheels.org/simple -r $PIP_REQUIREMENTS_FILE -qq > /dev/null & |
There was a problem hiding this comment.
The piwheels repository is only available for ARMv6/ARMv7/ARMv8 architectures (Raspberry Pi). Using --extra-index-url makes pip fall back to PyPI if packages aren't found on piwheels, but this change will cause installation to fail on non-ARM architectures if the package exists on piwheels but is incompatible with the host architecture.
The install script doesn't detect the system architecture before adding the piwheels index. Consider adding an architecture check to conditionally include the piwheels URL only when running on ARM-based systems. For example, you could check if the output of 'uname -m' is 'armv6l', 'armv7l', or 'aarch64' before adding the --extra-index-url flag.
| $VENV_PATH/bin/python -m pip install --extra-index-url https://www.piwheels.org/simple --upgrade pip setuptools wheel > /dev/null | ||
| $VENV_PATH/bin/python -m pip install --extra-index-url https://www.piwheels.org/simple -r $PIP_REQUIREMENTS_FILE -qq > /dev/null & |
There was a problem hiding this comment.
The update.sh script also contains pip install commands (lines 109 and 114) that should be updated to use piwheels for consistency with the install.sh changes. Without this update, subsequent updates will not benefit from the faster piwheels installation on Raspberry Pi devices. The same architecture detection approach suggested for install.sh should be applied here as well.
my raspberry pi zero could never finish the install script (stuck on Installing python dependencies. [/], was it building from source?). I waited ~16 hours. by using pywheels, it finishes in a few minutes.