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 没有正确重定向输出。有任何想法吗 ?

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

1 回答 1

0

这通常意味着控制台环境与 LiClipse 环境不同。

要修复它,请从 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 上)环境变量中。

您还可以尝试从您启动命令的同一 shell 启动 LiClipse,以便它继承您从 shell 获得的环境变量。

于 2017-04-11T19:05:18.843 回答