2016-05-30 53 views
4

當我嘗試安裝pyobjc框架,可可我看到這個錯誤:的Python PyObjC_IdToPython(@protocol(NSURLSessionStreamDelegate))錯誤

In file included from Modules/_Foundation.m:15: 
    Modules/_Foundation_protocols.m:14:28: error: cannot find protocol declaration for 'NSProgressReporting' 
     p = PyObjC_IdToPython(@protocol(NSProgressReporting)); Py_XDECREF(p); 
         ^
    Modules/_Foundation_protocols.m:15:28: error: cannot find protocol declaration for 'NSURLSessionStreamDelegate' 
     p = PyObjC_IdToPython(@protocol(NSURLSessionStreamDelegate)); Py_XDECREF(p); 
         ^
    2 errors generated. 
    error: command '/usr/bin/clang' failed with exit status 1 

回答

4

我能夠避免在以下環境問題:

Mac OS X 10.10.5 
pip8.1.2 
python3.4 

請嘗試以下命令。

pip uninstall pyobjc-core
pip install pyobjc==3.0.4

問題的原因似乎是「pyobjc-core3.1.1」的交付錯誤。
如果在3.0.4中統一,它應該會很好。

乾杯!

+1

確保「pyobjc == 3.0.4」中沒有空格, – watsonic