Mac OS installation no longer possible

Issue #231 new
Garrett Mace created an issue

Versions of PyQt4 compatible with macOS Sierra don't currently exist. PyQtX requires Qt 4.8.2 libs which will not install on Sierra, and PyQtX also fails install. Homebrew no longer offers a compatible PyQt4; it installs PyQt5 which requires Python 3. Python 3 is of course not compatible with FlatCAM.

Unfortunately it seems the only long-lasting, non-duct-taped solution would be porting the project to Python 3.

Comments (19)

  1. Juan Pablo Caram repo owner

    I cannot help much with MacOS, but a simple search shows that:

    • PyQt4 works with Qt5
    • Qt5 works with Python 2.7
  2. Josh Brown

    Should have checked here earlier but ended up spending the day trying to install on Mac OS instead with no luck. Ended up trying all the methods @macegr mentioned and probably more, trying to get PyQt4 via Homebrew, using PyQtX instead, trying to install Qt libs, re-installing python 2.7, etc.

    The issue is not being able to install PyQt4 and, as seen below Homebrew only installs PyQt5 which only works in Python3.

    > brew info pyqt
    pyqt: stable 5.8.1 (bottled)
    Python bindings for v5 of Qt
    https://www.riverbankcomputing.com/software/pyqt/download5
    /usr/local/Cellar/pyqt/5.8.1_1 (856 files, 24.6MB) *
      Poured from bottle on 2017-04-08 at 15:49:22
    From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/pyqt.rb
    

    @macegr If you do have a short-lasting, duct-taped solution then it'd be good to hear!

  3. Benn Mapes

    Hi, just saw this and thought I'd help you out a bit. I managed to get it up and running on mac OSX Sierra using the latest MacPorts (2.4.1). PyQt4 installed but took a long time. I followed jimthompson's post here -> http://flatcam.org/discussion#!/?mac%20osx I'll post the steps I took here for completeness.

    sudo port install python27
    sudo port select —set python python27
    sudo port select —set python2 python27
    sudo port install py27-readline
    sudo port install py27-sip
    sudo port install py27-pyqt4 # fails: complains about dbus - (Note: I didn't have this issue, pyqt installed first try but this was in  the original post)
    sudo port -f activate bus
    sudo launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist
    sudo port install py27-pyqt4 #(second time – this one succeeds – but takes a long, long time, most of it in the final configuring and building steps.)
    sudo port install py27-simplejson
    sudo port install py27-tkinter
    sudo port install py27-numpy
    sudo port install py27-matplotlib
    sudo port install py27-rtree
    sudo port install py27-shapely
    sudo port install py27-cairo
    sudo port install py27-pip
    sudo python -m pip install svg.path
    

    Hope this works for you, good luck!

  4. Francisco Blanco

    I'm also stuck at "Setting Up The Environment" could anyone explain exactly what I have to do? Thanks

  5. Fernando “Nando” Morais

    I managed to make it work just following the instructions to install pyqt4. No change made to the env python path. (most definitely that was what messed up your python install) There was some extra libs needed, but you get those from the errors and install using pip. like svg.path.

  6. robonobo

    Good job Fernando! In all honesty, In recent times, I've started favouring PySide and PySide2 over PyQt4. They seem to be far more straightforward to install. Whichever library you use, it's possible to use Frederik Averpil's Qt module to unify code, just so long as you have one of the libraries.

  7. Fernando “Nando” Morais

    Interesting, I don't know PySide & PySide2, will give that a look.

    At first I started converting to PyQt5 as it would be far easier in regards to libs management, but some components changed and I went back to try with PyQt4. Plus I guess to submit a pull request it will also affect Linux & Win as the code base is the same.

    One last thing that would be cool would be to package it for OSX, as I believe this would end this libs dependency nightmare.

  8. robonobo

    PyQt4 and PyQt5 are administered by Riverbank Computing, whereas PySide and PySide2 are equivalent the ui technologies utilised by Python. Luckily, the code can all be tied together using that Qt module

  9. Maxim Kulkin

    What happened to that nice PR of @Roman Valls ? When will fellow Mac users get a native application?

    PS I just spent several hours (before finding out this issue and brainstorm’s PR) to migrate to PyQt5 and it works for my purposes so far, but I would like it to be cemented in master. @jpcgt this migration is not the small one, you have to update everything at once. @Roman Valls did a nice job of not making it one big commit, so you can actually trace step by step what he was doing by looking at all commits that he made. Would you reconsider his PR?

    If not, how can we make this happen?

  10. Roman Valls

    Thanks for the kind words and support for my past work Maxim 🙂

    I also though that I segmented the work on that PR appropriately but @jpcgt closed it and I also got some flak/criticism from another dev that did not like pyqt5 and wanted to stick with pyqt4 “because it is faster”…

    I just lost interest because of those two events, but please do pick it up and PR it back to @jpcgt, I think this project deserves such a modernisation, IMHO.

  11. Marius Stanciu

    Hi Maxim,

    You can have a look at FlatCAM beta currently in version 8.96.

    It’s build over FlatCAM VisPy branch and I did ported it to Python 3.x / PyQt 5.x since last year. The hard part was that FlatCAM 8.5 rely on try - except blocks assuming that raising an Exception is a non-fatal error. Which in PyQt5 it is, crashing the app immediately. But over time I managed to solve those issues.
    Using the x64 packages and the mentioned port, the speed of FlatCAM beta is over 100% better than in FlatCAM 8.5: a complicated Gerber file load in FlatCAM beta took less than half the time needed by FlatCAM 8.5.

    Users reported that they are running it successfully on MacOS. For myself I only tried once with an older build into a VmWare virtual machine and it worked without issues.

  12. Maxim Kulkin

    @Marius Stanciu Thank you for response. I checked Beta branch, but I do not quite understand what is the proper way to run the app: there is no setup.py and no flatcam or any other executable as it used to be.

  13. Marius Stanciu

    @Maxim Kulkin,

    There is a FlatCAM.py file that needs to be run for the App to start. For the dependencies look in the requirements.txt or setup_ubuntu.sh

  14. Torsten Curdt

    What’s the current status here? And what’s the plan for python3?
    I am on a macOS 12.4 on ARM.

  15. Log in to comment