PySide2 easy install!

Yesterday, @jschueller added pyside2-feedstock to conda-forge. This means we can now finally install PySide2 easily in Python 2.7, 3.5 and 3.6 on Windows, Linux and macOS using conda.

# Enable conda-forge
conda config --add channels conda-forge

# Install PySide2
conda install pyside2

And. It. Frickin’. Just. Works.

Install conda

I prefer to use the miniconda distribution of Conda, which means you just get conda without any extras.

Below, some examples on how to install miniconda silently. As usual, more info in their docs on this.

macOS

# Download
wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O ~/miniconda.sh

# Install
bash ~/miniconda.sh -b -p $HOME/miniconda3

# Add "conda" to $PATH
echo 'export PATH="$HOME/miniconda3/bin:$PATH"' >> ~/.bashrc

Linux

# Download
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh

# Install
bash ~/miniconda.sh -b -p $HOME/miniconda3

# Add "conda" to $PATH
echo 'export PATH="$HOME/miniconda3/bin:$PATH"' >> ~/.bashrc

Windows (powershell)

# Download
(New-Object System.Net.WebClient).DownloadFile("https://repo.continuum.io/miniconda/Miniconda3-latest-Windows-x86_64.exe", "${HOME}\Downloads\Miniconda3-latest-Windows-x86_64.exe")

# Install and add "conda" to $PATH
Start-Process "${HOME}\Downloads\Miniconda3-latest-Windows-x86_64.exe" "/S /D=${HOME}\Miniconda3 /AddToPath=1"

Install conda environment

This is the same for all platforms, given that conda exists on $PATH and that you’re using Powershell if on Windows.

# Enable conda-forge
conda config --add channels conda-forge

# Create environment with Python 3.6, PySide2
conda create --mkdir --prefix ~/condaenvs/myenv python=3.6 pyside2

# Run Python
~/condaenvs/myenv/bin/python --version

# Run pip
~/condaenvs/myenv/bin/pip --version