Search code examples
pythoncmacosdata-analysis

Torch7 Mac Installation error


I am trying to install in mac machine Torch7. When I am trying to install torch using this tutorial https://github.com/torch/torch7/wiki/Cheatsheet#installing-and-running-torch on the second line(curl -sk https://raw.githubusercontent.com/torch/ezinstall/master/install-luajit+torch | bash) I am facing the following error:

-- Looking for QT_MAC_USE_COCOA - found CMake Error at /usr/local/Cellar/cmake/2.8.12.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:108 (message): Could NOT find Qt4 (missing: QT_MOC_EXECUTABLE QT_RCC_EXECUTABLE QT_UIC_EXECUTABLE) (found suitable version "4.7.4", minimum required is "4.3.0") Call Stack (most recent call first): /usr/local/Cellar/cmake/2.8.12.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:315 (_FPHSA_FAILURE_MESSAGE) /usr/local/Cellar/cmake/2.8.12.2/share/cmake/Modules/FindQt4.cmake:1393 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) CMakeLists.txt:27 (FIND_PACKAGE)

Have you experienced this problem before? Thanks


Solution

  • After running curl -s https://raw.githubusercontent.com/torch/ezinstall/master/install-all | bash as advised at https://github.com/torch/ezinstall I got the same error, i.e.

    Could NOT find Qt4 (missing: QT_MOC_EXECUTABLE QT_RCC_EXECUTABLE QT_UIC_EXECUTABLE) (found suitable version "4.8.6", minimum required is "4.3.0")

    When I ran which qmake I found that qmake was located in ~/anaconda/bin/qmake. I tried a bunch of different things to set the QT_MOC_EXECUTABLE, QT_RCC_EXECUTABLE, and QT_UIC_EXECUTABLE paths correctly e.g.

    qmake -set "QT_MOC_EXECUTABLE" /usr/local/Cellar/qt/4.8.6/bin/moc qmake -set "QT_RCC_EXECUTABLE" /usr/local/Cellar/qt/4.8.6/bin/rcc qmake -set "QT_UIC_EXECUTABLE" /usr/local/Cellar/qt/4.8.6/bin/uic

    But nothing worked.

    So what I did was remove the anaconda installation via rm -rf ~/anaconda

    I ran curl -s https://raw.githubusercontent.com/torch/ezinstall/master/install-all | bash again, and everything install correctly. Then I just reinstalled anaconda.

    That was a relief. It's probably not the best solution, but I hope this can also work for you.