Skip to content

Instantly share code, notes, and snippets.

@someburner
Forked from jinwoo1225/PyQt6.sh
Created April 13, 2023 07:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save someburner/0d8f4a6136f35f2af82f4599997c798a to your computer and use it in GitHub Desktop.
Save someburner/0d8f4a6136f35f2af82f4599997c798a to your computer and use it in GitHub Desktop.
Install PyQt6 on macOS for M1 (Apple Silicon) Devices
#!/bin/bash
# Assumes brew and python are installed
brew install qt@6 llvm cmake ninja git
# Setup environment
mkdir -p ~/.pyqt6; cd ~/.pyqt6
curl https://files.pythonhosted.org/packages/a0/07/0ae4f67768c1150af851572fae287aeaf956ed91b3b650b888a856274ae4/PyQt6-6.1.1.tar.gz --output PyQt6-6.1.1.tar.gz
curl https://files.pythonhosted.org/packages/50/24/743c4dd6a93d25570186a7940c4f072db1cf3fa919169b0ba598fcfc820a/PyQt6_sip-13.1.0.tar.gz --output PyQt6_sip-13.1.0.tar.gz
curl https://files.pythonhosted.org/packages/ea/5e/4c954451984d00dfc051eab5c4b40453923a85f5a0dfa9678511d06eec5e/PyQt6_3D-6.1.1.tar.gz --output PyQt6_3D-6.1.1.tar.gz
curl https://files.pythonhosted.org/packages/b9/ac/9c545186f3125b0fb02359938bddde0167344f3d4e14aee17fa122b5287a/PyQt6_Charts-6.1.1.tar.gz --output PyQt6_Charts-6.1.1.tar.gz
curl https://files.pythonhosted.org/packages/56/8d/ddf81fe59263a0855d58b9f91d957e0956f3ea0aab17f0433f5cc69d4e8e/PyQt6_DataVisualization-6.1.1.tar.gz --output PyQt6_DataVisualization-6.1.1.tar.gz
curl https://files.pythonhosted.org/packages/04/cc/6e60bbc105992a9c2a98bb9135987baa4f35b27593a5e3ebf7ac2728ce0c/PyQt6_NetworkAuth-6.1.1.tar.gz --output PyQt6_NetworkAuth-6.1.1.tar.gz
tar -xvf PyQt6-6.1.1.tar.gz
tar -xvf PyQt6_sip-13.1.0.tar.gz
tar -xvf PyQt6_3D-6.1.1.tar.gz
tar -xvf PyQt6_Charts-6.1.1.tar.gz
tar -xvf PyQt6_DataVisualization-6.1.1.tar.gz
tar -xvf PyQt6_NetworkAuth-6.1.1.tar.gz
python3 -m venv testenv
source testenv/bin/activate
pip install PyQt-builder
# Build and install PyQt6
export CLANG_INSTALL_DIR=$(brew --prefix)/opt/llvm
cd ./PyQt6_sip-13.1.0
python setup.py install
cd ../PyQt6-6.1.1
sip-install
cd ../PyQt6-6.1.1
sip-install
cd ../PyQt6_3D-6.1.1
sip-install
cd ../PyQt6_Charts-6.1.1
sip-install
cd../PyQt6_DataVisualization-6.1.1
sip-install
cd../PyQt6_NetworkAuth-6.1.1
sip-install
# additional packages can be downloaded from https://www.riverbankcomputing.com/pypi/simple/ and installed using sip-install
# Function to copy PySide6 to new environment
echo 'function copy-pyside {
export PYQT6=~/.pyqt6/testenv/
export VENV=$1
rsync -av $PYQT6/bin/PyQt6-* $VENV/bin; rsync -av $PYQT6/lib/python3.9/site-packages/PyQt6-* $VENV/lib/python3.9/site-packages/
}' >> ~/.zshrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment