Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Building PythonQT on macOS?

Building PythonQT on macOS?

Scheduled Pinned Locked Moved Unsolved General and Desktop
pythonmac oshomebrewqmake
4 Posts 2 Posters 753 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hsetlik
    wrote on 30 Aug 2021, 20:24 last edited by
    #1

    Hi,
    I've been trying to embed Python in a Qt/C++ application using PythonQt. For context I'm running Catalina 10.15.7 with Qt version 5.15.2. Trying to build PythonQt as per these instructions with qmake gives a linker error about the python installation:

    ld: can't map file, errno=22 file '/usr/local/Cellar/python@3.9/3.9.6/Frameworks' for architecture x86_64
    

    I imagine this has to do with either the actual python installation from Homebrew or the paths given in the 'python.prf' file, which right now are set like so:

    macx {
      # for macx you need to have the Python development kit installed as framework
      INCLUDEPATH += /usr/local/Cellar/python@3.9/3.9.6/Frameworks/Python.framework/Headers
      LIBS += /usr/local/Cellar/python@3.9/3.9.6/Frameworks -framework Python
    }
    

    Much appreciated if anyone knows what I'm doing wrong here with the include paths or the python installation, thanks.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 31 Aug 2021, 19:26 last edited by
      #2

      Hi and welcome to devnet,

      You forgot the -F before the path your custom Python framework.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • H Offline
        H Offline
        hsetlik
        wrote on 31 Aug 2021, 21:44 last edited by
        #3

        Oh thank you- it's not complaining about the framework path anymore and qmake finishes successfully but trying to actually run any of the example projects gives me this:

        :-1: error: No rule to make target `/Qt/5.15.2/clang_64/lib/libQt5UiTools_debug.a', needed by `../../lib/libPythonQt_QtAll-Qt5-Python3.9_d.3.2.0.dylib'.  Stop.
        

        Is this some kind of an incompatibility issue with one of Qt's libs?

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 2 Sept 2021, 19:12 last edited by
          #4

          Looks like a build error, no ?

          Are you using a pre-built version of Qt ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          2/4

          31 Aug 2021, 19:26

          • Login

          • Login or register to search.
          2 out of 4
          • First post
            2/4
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved