Mac M1 & PySide 2/6 can't Install lib
-
wrote on 1 Mar 2021, 13:07 last edited by Dariusz 3 Jan 2021, 13:09
Hey
I'm trying to install PySide2/6 on my m1 mac but all I get is >
ERROR: Could not find a version that satisfies the requirement PySide2 ERROR: No matching distribution found for PySide2
Any ideas how to bite it?
TIA
-
Hi,
How are you trying to install it ?
Using the system pip ? Conda ? Brew ? Macports ? -
wrote on 1 Mar 2021, 20:37 last edited by
Pycharm just in settings > interpreter + PySide2/ PySide6
As well as I tried via pip install I think too.
I'm new to Mac so perhaps thats totally wrong way of doing it ?
TIA -
There are several possible ways to handle Python on macOS.
However, based on the Qt for Python Wiki page, it looks like the M1 is not yet natively supported.
I would check with homebrew and/or conda.
-
There are several possible ways to handle Python on macOS.
However, based on the Qt for Python Wiki page, it looks like the M1 is not yet natively supported.
I would check with homebrew and/or conda.
-
Qt for Python is not yet supported.
You can still develop in C++ or try to build PySide2/6 yourself.
-
wrote on 24 Jul 2021, 15:48 last edited by GRomR1
Hi @Dariusz
I use this article and I successfully build PySide6 - 6.1.2 from sources on my MacBook Pro with M1.In the begin I start install necessary utilities via brew:
brew install qt@6 llvm cmake ninja
After that I clone the setup repo, activate python venv and install python packages:
git clone --recursive https://code.qt.io/pyside/pyside-setup cd pyside-setup && git checkout 6.1.2 python3 -m venv testenv source testenv/bin/activate pip install -r requirements.txt
I've found that the installation will work only if set this system variable:
export CLANG_INSTALL_DIR=/opt/homebrew/opt/llvm
Next I run the build process. It takes a while time (check the correct path for qmake -
qmake -v
):python setup.py build --qmake=/opt/homebrew/Cellar/qt/6.1.2/bin/qmake --build-tests --ignore-git --parallel=8
In the result I see the finish message:
--- Build completed (413s)
To install the PySide into the current virtual env run this:
python3 setup.py install --qmake=/opt/homebrew/Cellar/qt/6.1.2/bin/qmake --build-tests --ignore-git --parallel=8 --reuse-build
Completed. You will see the PySide package in pip list:
pip list | grep PySide PySide6 6.1.2
Also I use these commandd to copy the installed package to another project
export MY_PROJECT_VENV_PATH=../another-project/venv rsync -av testenv/bin/shiboken6* $MY_PROJECT_VENV_PATH/bin rsync -av testenv/bin/pyside6-* .$MY_PROJECT_VENV_PATH/bin rsync -av testenv/lib/python3.9/site-packages/PySide6* $MY_PROJECT_VENV_PATH/lib/python3.9/site-packages/ rsync -av testenv/lib/python3.9/site-packages/shiboken6* $MY_PROJECT_VENV_PATH/lib/python3.9/site-packages/
-
wrote on 14 Oct 2021, 20:25 last edited by
Hi this was of great help, however I cannot get it done.
As of today the only difference for me is that the version downloaded by brew was 6.2.0.
In the last compilation steps I get an error saying:CMake Error at cmake_install.cmake:61 (file): file INSTALL cannot find "/opt/homebrew/Cellar/qt/6.2.0/bin/Assistant.app": No such file or directory.
I have no idea whay that is missing or how to get it. Any help is appreciated.
Thanks,
Santi -
Hi this was of great help, however I cannot get it done.
As of today the only difference for me is that the version downloaded by brew was 6.2.0.
In the last compilation steps I get an error saying:CMake Error at cmake_install.cmake:61 (file): file INSTALL cannot find "/opt/homebrew/Cellar/qt/6.2.0/bin/Assistant.app": No such file or directory.
I have no idea whay that is missing or how to get it. Any help is appreciated.
Thanks,
Santiwrote on 29 Oct 2021, 14:44 last edited by@sanpen
just need to create some links, then you can walk around the issue.cd /opt/homebrew/Cellar/qt/6.2.0/bin
ln -s /opt/homebrew/Cellar/qt/6.2.0/libexec/Assistant.app Assistant.app
ln -s /opt/homebrew/Cellar/qt/6.2.0/libexec/Designer.app Designer.app
ln -s /opt/homebrew/Cellar/qt/6.2.0/libexec/Linguist.app Linguist.app
ln -s /opt/homebrew/Cellar/qt/6.2.0/libexec/pixeltool.app pixeltool.app
ln -s /opt/homebrew/Cellar/qt/6.2.0/libexec/qdbusviewer.app qdbusviewer.app -
wrote on 30 Oct 2021, 20:05 last edited by
I just saw this thread. @Dariusz, go into the /Applications folder on your Mac and right click the 'Terminal' app in the Utilities folder. You'll see a check box for 'Open using Rosetta'. If you check that, you should be good to go. Just close and reopen the Terminal app if it was already open. Hope that works.
-
@sanpen
just need to create some links, then you can walk around the issue.cd /opt/homebrew/Cellar/qt/6.2.0/bin
ln -s /opt/homebrew/Cellar/qt/6.2.0/libexec/Assistant.app Assistant.app
ln -s /opt/homebrew/Cellar/qt/6.2.0/libexec/Designer.app Designer.app
ln -s /opt/homebrew/Cellar/qt/6.2.0/libexec/Linguist.app Linguist.app
ln -s /opt/homebrew/Cellar/qt/6.2.0/libexec/pixeltool.app pixeltool.app
ln -s /opt/homebrew/Cellar/qt/6.2.0/libexec/qdbusviewer.app qdbusviewer.appwrote on 11 Jan 2022, 00:55 last edited by@lyoo said in Mac M1 & PySide 2/6 can't Install lib:
@sanpen
just need to create some links, then you can walk around the issue.cd /opt/homebrew/Cellar/qt/6.2.0/bin
ln -s /opt/homebrew/Cellar/qt/6.2.0/libexec/Assistant.app Assistant.app
ln -s /opt/homebrew/Cellar/qt/6.2.0/libexec/Designer.app Designer.app
ln -s /opt/homebrew/Cellar/qt/6.2.0/libexec/Linguist.app Linguist.app
ln -s /opt/homebrew/Cellar/qt/6.2.0/libexec/pixeltool.app pixeltool.app
ln -s /opt/homebrew/Cellar/qt/6.2.0/libexec/qdbusviewer.app qdbusviewer.appThis worked, but interestingly the bin directory as of 6.2.2 contains aliases for these apps, just without the .app suffix.
-
wrote on 12 Jan 2022, 13:28 last edited by
FYI: PySide 6.2.2+ provide support for Apple Silicon, so you could simple run a
pip install pyside6
and get it.
Because PySide2 is in maintenance mode, there has been no discussion on backporting the support.