vpype: vpype[all] can't be installed on Mac OSX on ARM based Macs (M1)
Edit by @abey79:
Thanks to MacPorts now properly supporting pyside2 and its dependences (in particular qt5-qtwebengine, thanks @chrstphrchvz!), this issue is now resolved. The install procedure is as follows:
Install/upgrade MacPorts
If you don’t have MacPorts installed, install it from here. You will need to install Xcode if you haven’t already.
If you had MacPorts previously installed, make sure its package database is up-to-date:
sudo port selfupdate
sudo port upgrade outdated
Install required packages
sudo port install python39 py39-shapely py39-scipy py39-numpy py39-pyside2
(optional) Make Python 3.9 the default interpreter
This is not strictly necessary, but this step will make python
point towards MacPorts’ Python 3.9.x.
sudo port select --set python python39
Create a virtual environment for vpype
cd path/where/the/venv/should/be
/opt/local/bin/python3.9 -m venv vpype_venv --system-site-packages
Important: note the use of --system-site-packages
. This will make the MacPorts-installed package (in particular pyside2) available to the virtuel environment. This is critically important because pip
is unable to install PySide2 on arm64 Macs (this will likely never change).
Using the full path for the python interpreter is not needed if python
points to the right interpreter (ie. you did the previous step and your PATH
is not messed up.
Activate the virtual environment and install vpype
source vpype_venv/bin/activate
pip install "vpype[all]"
Check that the install was successful:
vpype random show
original message by @theomega
This is very likely not vpypes fault, but you can’t install vpype using pip on Mac OSX if your machine is one of the new m1 based arm machines.
Reason is that the PySides2 package can’t be installed on these machines as there is no official port of QT python bindings for the M1 yet.
Error Message:
ERROR: Cannot install vpype[all]==1.4.0, vpype[all]==1.5.0, vpype[all]==1.5.1, vpype[all]==1.6.0 and vpype[all]==1.7.0 because these package versions have conflicting dependencies.
The conflict is caused by:
vpype[all] 1.7.0 depends on PySide2<6.0.0 and >=5.15.2; extra == "all"
vpype[all] 1.6.0 depends on PySide2<6.0.0 and >=5.15.2
vpype[all] 1.5.1 depends on PySide2<6.0.0 and >=5.15.2
vpype[all] 1.5.0 depends on PySide2<6.0.0 and >=5.15.2
vpype[all] 1.4.0 depends on PySide2<6.0.0 and >=5.15.2
Manual install of PySide2:
$ pip install PySide2
ERROR: Could not find a version that satisfies the requirement PySide2 (from versions: none)
ERROR: No matching distribution found for PySide2
Some more information can be found on the QT Forum here: https://forum.qt.io/topic/124289/mac-m1-pyside-2-6-can-t-install-lib
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 32 (18 by maintainers)
Edit: updated required package list based on @abruto’s feedback. Edit: added forced submodule updated based on @abruto’s feedback.
I just managed to get everything running on Monterey/M1 using the following procedure
TL;DR
Install/upgrade MacPorts
If you don’t have MacPorts installed, install it from here. You will need to install Xcode if you haven’t already.
If you had MacPorts previously installed, make sure its package database is up-to-date:
Install required packages
Create a virtual environment for vpype
Note the use of the full path for the python interpreter to ensure that the good one is actually used for the venv.
Build PySide2 from source
Checkout PySide2 source:
Build PySide2 and install it in your virtual environment. CAUTION: the
vpype_venv
virtual environment must be activated before running this command!Install vpype
pip
would fail installing PySide2 but, since it is already installed, it will simply skip it and the regular install should work:Check that the install was successful:
PySide2 is now available in MacPorts 🥳 I’ve put the updated installation instruction in the top comment and pinned this issue for visibility.
scipy 1.7.3 with arm binaries has been released yesterday 🎉
FYI, I just got a new M1 Max MBP and I’m actively researching this issue. My current understanding is that the situation will take some time to fully normalise, but there may be ways to get this sorted “manually” in the mean time. I’ll post here whenever I have such a method sorted out.
WIP notes/pointers:
@abey79 Got it. I was actually missing geos which was causing Shapely not to install. I had to run:
brew install geos
Excited to get the full vpype[all] installed when the libraries have better support for M1. Thanks for your work!
Yes, I could successfully build
Pyside2
and installvpype
. Thank you for the support!Well I’m not sure what else to suggest then. The ARM scipy release is likely imminent (https://github.com/scipy/scipy/issues/13409#issuecomment-974681045). In the mean time, one work around is to
pip install vpype matplotlib
and use the classic viewer.