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 pyside2And. It. Frickin’. Just. Works.
Update 2018-03-09The Qt Company now offers official and standalone wheels, read more here.
[!NOTE] Update 2018-07-17PySide2 can now be installed from pypi.org:
pip install PySide2!
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"' >> ~/.bashrcLinux
# 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"' >> ~/.bashrcWindows (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, add "conda" and "python" etc to $PATH
& "${HOME}\Downloads\Miniconda3-latest-Windows-x86_64.exe" /S /AddToPath=1 /D=${HOME}\miniconda3Install 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