Orange Forum • View topic - Help building orange on Mac OSX Mavericks

Help building orange on Mac OSX Mavericks

A place to ask questions about methods in Orange and how they are used and other general support.

Help building orange on Mac OSX Mavericks

Postby fiksen » Fri May 30, 2014 12:39

Hi, I've forked the orange repository to implement some of my own stuff, but I'm having trouble getting my development environment set up. I'm using python 2.7 on Mac OSX. I installed SIP 4.16 and ran
Code: Select all
python configure-ng.py
then make and make install to install PyQt4 (v4.11).

Now when i run python setup.py [any argument] I get the error:

Code: Select all
Traceback (most recent call last):
  File "setup.py", line 152, in <module>
    orangeqt_setup = imp.load_source('orangeqt_setup', os.path.join(os.path.dirname(__file__), 'source/orangeqt/setup.py'))
  File "source/orangeqt/setup.py", line 163, in <module>
    site_cfg = site_config()
  File "source/orangeqt/setup.py", line 144, in site_config
    framework_dir = get("qt", "framework_dir", default=qt_framework_dir)
NameError: global name 'qt_framework_dir' is not defined


I've narrowed it down to using a more recent version of PyQt4 so
Code: Select all
    from PyQt4 import pyqtconfig

fails in source/orangeqt/setup.py

So does the if condition
Code: Select all
if "QTDIR" in os.environ:

meaning the variable
Code: Select all
qt_framework_dir
is never set

I've tried setting my QTDIR environmental variable to /Library/Frameworks folder as that is where all the Qt*.framework folders are, but that just gives me the error:
Code: Select all
Traceback (most recent call last):
  File "setup.py", line 152, in <module>
    orangeqt_setup = imp.load_source('orangeqt_setup', os.path.join(os.path.dirname(__file__), 'source/orangeqt/setup.py'))
  File "source/orangeqt/setup.py", line 94, in <module>
    elif glob(pjoin(qt_dir, "Frameworks", "Qt*.framework")):
TypeError: 'module' object is not callable


Any help in setting up my dev environment would be appreciated

Re: Help building orange on Mac OSX Mavericks

Postby Ales » Fri May 30, 2014 13:30

The recommended way is to use homebrew to install sip/pyqt/pyqwt

The problem is you configured sip (and most probably PyQt4) using the configure-ng.py instead of configure.py.

The other installation method is not really tested.

As a quick fix, run
Code: Select all
echo "raise ImportError" > source/orangeqt/setup.py
python setup.py build

Re: Help building orange on Mac OSX Mavericks

Postby fiksen » Tue Jun 03, 2014 18:10

ok thanks, with much pain I was able to fix my python environment (new to Mac development!) and have gotten past the error, after running brew install on python, sip, pyqt and pyqwt.

However now the build script fails at:

Code: Select all
In file included from source/orange/lib_kernel.cpp:2891:
source/orange/numeric_interface.hpp:11:12: fatal error: 'numpy/arrayobject.h'
      file not found
  #include <numpy/arrayobject.h>
           ^
1 error generated.


I also can't run in Eclipse or Pycharm, running
Code: Select all
python Orange/OrangeCanvas/orngCanvas.pyw
gives me the error.

Code: Select all
/Library/Python/2.7/site-packages/Orange-2.7.5-py2.7-macosx-10.6-intel.egg/Orange/__init__.py:68: UserWarning: Some features will be disabled due to failing modules
Importing 'utils' failed: No module named numpy
  _import("utils")
Traceback (most recent call last):
  File "Orange/OrangeCanvas/orngCanvas.pyw", line 7, in <module>
    import Orange
  File "/Library/Python/2.7/site-packages/Orange-2.7.5-py2.7-macosx-10.6-intel.egg/Orange/__init__.py", line 71, in <module>
    _import("data.io")
  File "/Library/Python/2.7/site-packages/Orange-2.7.5-py2.7-macosx-10.6-intel.egg/Orange/__init__.py", line 31, in _import
    __import__(name, globals(), locals(), [], -1)
  File "/Library/Python/2.7/site-packages/Orange-2.7.5-py2.7-macosx-10.6-intel.egg/Orange/data/io.py", line 213, in <module>
    loadARFF = Orange.utils.deprecated_keywords(
AttributeError: 'module' object has no attribute 'utils'


Looked around and still not sure how to continue. Thanks

Re: Help building orange on Mac OSX Mavericks

Postby Ales » Thu Jun 05, 2014 10:52

Now it is complaining that it is missing numpy library in the new python environment. I'm using numpy/scipy build from source but you might try installing them through brew by taping Homebrew/python (i have not tested if this works). Run
Code: Select all
brew tap Homebrew/python
brew install numpy
brew install scipy


Return to Questions & Support



cron