2012-04-19 80 views
9

我想在我的Mac OS X 10.7.3(獅子)安裝Orange:「錯誤命令‘鐺’,退出狀態1失敗」,我不斷收到錯誤或者PIP或從源頭上建設。首先,我得到的錯誤如下:無法安裝橙色:當使用

error: command 'gcc-4.0' failed with exit status 1 

我有Xcode 4,它與gcc 4.2.1捆綁在一起。所以我安裝64-bit/32-bit Python 2.7.3,其內置了GCC 4.2我也嘗試過使用覆蓋編譯器的選擇:

export CC=gcc-4.2 

但是,這產生了不同的錯誤:

gcc-4.2 not found, using clang instead 
... 
error: command 'clang' failed with exit status 1 

以下是完整的日誌:

$ python setup.py build 
running build 
running build_py 
copying Orange/version.py -> build/lib.macosx-10.6-intel-2.7/Orange 
running build_ext 
gcc-4.2 not found, using clang instead 
building 'Orange.orange' extension 
running pyxtract for Orange.orange 
/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python ../pyxtract/defvectors.py 
/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python ../pyxtract/pyprops.py -n orange 
/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python ../pyxtract/pyxtract.py -m -n orange lib_kernel.cpp lib_components.cpp lib_preprocess.cpp lib_learner.cpp lib_io.cpp lib_vectors.cpp cls_example.cpp cls_value.cpp cls_orange.cpp cls_misc.cpp functions.cpp orange.cpp 
Parsing lib_kernel.cpp 
Parsing lib_components.cpp 
Parsing lib_preprocess.cpp 
Parsing lib_learner.cpp 
Parsing lib_io.cpp 
Parsing lib_vectors.cpp 
Parsing cls_example.cpp 
Parsing cls_value.cpp 
Parsing cls_orange.cpp 
Parsing cls_misc.cpp 
Parsing functions.cpp 
Parsing orange.cpp 
Warning: class 'PearsonCorrelation' will not be picklable 
Warning: class 'ItemsetNodeProxy' will not be picklable 
clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -INone -Isource/include -Isource/orange/liblinear -Isource/orange/ppp -Isource/orange/px -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c source/orange/assoc.cpp -o build/temp.macosx-10.6-intel-2.7/source/orange/assoc.o -fPIC -fpermissive -fno-common -w -DDARWIN -DORANGE_EXPORTS 
clang: warning: argument unused during compilation: '-fpermissive' 
In file included from source/orange/assoc.cpp:25: 
In file included from source/orange/random.hpp:26: 
In file included from source/orange/root.hpp:25: 
source/orange/garbage.hpp:221:9: error: use of undeclared identifier 'raiseError' 
     raiseError("bad cast from %s to %s", typeid(U).name(), typeid(T).name()); 
     ^
source/orange/garbage.hpp:253:7: error: use of undeclared identifier 'raiseError' 
     raiseError("Orange internal error: NULL pointer to '%s'", TYPENAME(typeid(T))); 
    ^
source/orange/garbage.hpp:261:7: error: use of undeclared identifier 'raiseError' 
     raiseError("Orange internal error: NULL pointer to '%s'", TYPENAME(typeid(T))); 
    ^
source/orange/garbage.hpp:301:7: error: use of undeclared identifier 'raiseError' 
     raiseError("Orange internal error: NULL pointer to '%s'", TYPENAME(typeid(T))); 
    ^
source/orange/garbage.hpp:312:7: error: use of undeclared identifier 'raiseError' 
     raiseError("Orange internal error: NULL pointer to '%s'", TYPENAME(typeid(T))); 
    ^
In file included from source/orange/assoc.cpp:27: 
source/orange/examplegen.hpp:143:38: error: expected member name or ';' after declaration specifiers 
    TExampleIterator::TExampleIterator(const TExampleIterator &other); 
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
source/orange/examplegen.hpp:143:38: error: expected ')' 
source/orange/examplegen.hpp:143:37: note: to match this '(' 
    TExampleIterator::TExampleIterator(const TExampleIterator &other); 
            ^
source/orange/assoc.cpp:33:1: error: explicit specialization of 'st_classDescription' after instantiation 
DEFINE_TOrangeVector_classDescription(PAssociationRule, "TAssociationRules", true, ORANGE_API) 
^ 
source/orange/orvector.hpp:105:57: note: expanded from macro 'DEFINE_TOrangeVector_classDescription' 
    TClassDescription TOrangeVector< _TYPE, _WRAPPED >::st_classDescription = { _NAME, &typeid(TOrangeVector< _TYPE, _WRAPPED >), &TOrange::st_classDescription, TOrange_properties, TOrange_components }; 
                 ^
source/orange/ppp/assoc.ppp:111:72: note: implicit instantiation first required here 
    {"rules", "association rules", &typeid(POrange), &TAssociationRules::st_classDescription, offsetof(TAssociationClassifier, rules), false, false, 0}, 
                    ^
8 errors generated. 
error: command 'clang' failed with exit status 1 
+0

那裏有一個錯誤信息 - 有什麼問題? – 2012-04-19 23:54:39

+0

問題是我無法安裝Orange,因爲我不斷收到上述錯誤 – 2012-04-20 00:24:28

+0

我已經在Orange上安裝了很多bug。從未像我一樣。這就是爲什麼我只使用scikits.learn,scikits.image,scikits.timeseries和scikits.statsmodels。也許值得一瞧。 – ely 2012-04-20 00:49:42

回答

14

問題解決:Xcode 4實際上並沒有配合gcc-4.2;它配備了新的LLVM編譯器。

這僅僅是一個做的事:

export CC=llvm-gcc-4.2 
export CXX=llvm-g++-4.2 

然後建立橙色。

+0

參見:http://orange.biolab.si/forum/viewtopic.php?f=4&t=1568 – 2012-11-01 05:02:41

1

http://orange.biolab.si/forum/viewtopic.php?f=4&t=1568

export CC=gcc 
export CXX=g++ 
pip install orange # for example 

似乎更健壯沒有進入版本號的詳細信息,如果你沒有,對不對? (我沒有之前做這樣的事情,所以我不知道。)

更新:本pip install orange例子(如上圖)目前installs an older version of Orange (version 2.5a4) instead of 2.6。要獲得開發版本,請使用:

pip install -e hg+https://bitbucket.org/biolab/orange#egg=Orange 

我從here得到了上述命令。

+0

試圖安裝「matplotlib」使用PIP時解決同樣的問題 – timothyjgraham 2017-06-15 01:36:56