2016-10-21 65 views
0
PyLint: Executing command line: /usr/local/bin/pylint --rcfile=/Users/amansehgal/.rcfile --include-ids=y /Users/amansehgal/Documents/cis519/hw3_skeleton/boostedDT.py 
PyLint: The stdout of the command line is: 
PyLint: The stderr of the command line is: Traceback (most recent call last): 
    File "/usr/local/bin/pylint", line 11, in <module> 
    sys.exit(run_pylint()) 
    File "/Library/Python/2.7/site-packages/pylint/__init__.py", line 12, in run_pylint 
    from pylint.lint import Run 
    File "/Library/Python/2.7/site-packages/pylint/lint.py", line 34, in <module> 
    import astroid 
    File "/Library/Python/2.7/site-packages/astroid/__init__.py", line 54, in <module> 
    from astroid.nodes import * 
    File "/Library/Python/2.7/site-packages/astroid/nodes.py", line 54, in <module> 
    from astroid.scoped_nodes import (
    File "/Library/Python/2.7/site-packages/astroid/scoped_nodes.py", line 25, in <module> 
    import io 
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/io.py", line 51, in <module> 
    import _io 
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so, 2): Symbol not found: __PyCodecInfo_GetIncrementalDecoder 
    Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so 
    Expected in: flat namespace 
in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so 

PyLint: Executing command line: /usr/local/bin/pylint --rcfile=/Users/amansehgal/.rcfile --include-ids=y /Users/amansehgal/Documents/cis519/hw3_skeleton/boostedDT.py 
PyLint: The stdout of the command line is: 
PyLint: The stderr of the command line is: Traceback (most recent call last): 
    File "/usr/local/bin/pylint", line 11, in <module> 
    sys.exit(run_pylint()) 
    File "/Library/Python/2.7/site-packages/pylint/__init__.py", line 12, in run_pylint 
    from pylint.lint import Run 
    File "/Library/Python/2.7/site-packages/pylint/lint.py", line 34, in <module> 
    import astroid 
    File "/Library/Python/2.7/site-packages/astroid/__init__.py", line 54, in <module> 
    from astroid.nodes import * 
    File "/Library/Python/2.7/site-packages/astroid/nodes.py", line 54, in <module> 
    from astroid.scoped_nodes import (
    File "/Library/Python/2.7/site-packages/astroid/scoped_nodes.py", line 25, in <module> 
    import io 
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/io.py", line 51, in <module> 
    import _io 
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so, 2): Symbol not found: __PyCodecInfo_GetIncrementalDecoder 
    Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so 
    Expected in: flat namespace 
in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so 

我試圖在LiClipse中運行pyLint並使用選項重定向消息到控制檯時出現此錯誤。我在命令提示符下運行該行,沒有任何錯誤。所以問題在於LiClipse沒有正確地重定向輸出。有任何想法嗎 ?使用liclipse時pylint錯誤

/usr/local/bin/pylint --rcfile=/Users/amansehgal/.rcfile --include-ids=y /Users/amansehgal/Documents/cis519/hw3_skeleton/boostedDT.py 

回答

0

這通常意味着控制檯env與LiClipse env不同。

要解決該問題,請從LiClipse內部和shell中打印環境變量。

你可以通過創建一個python腳本,例如:

for key, val in sorted(os.environ.items()): 
    print('%s:\n %s' % (key, '\n '.join(sorted(val.split(os.pathsep))))) 

,然後比較,你在這兩種情況下具有的值。

最常見的問題是在PATHPYTHONPATHDYLD_LIBRARY_PATH(在Mac上)或LD_LIBRARY_PATH(在Linux上)ENV變量。

您也可以嘗試從啓動命令的同一個shell啓動LiClipse,以便它從shell中繼承env變量。