ImportError:无法导入名称urandom Eclipse / PyDev

时间:2012-10-02 11:28:18

标签: python eclipse pydev

我知道这个问题已被多次询问过,但我无法自己解决这个问题。所以请耐心等待。

Traceback (most recent call last):
      File "/Users/someone/Desktop/eclipse/plugins/org.python.pydev_2.6.0.2012062818/pysrc/pydevd.py", line 3, in <module>
        import pydev_imports
      File "/Users/someone/Desktop/eclipse/plugins/org.python.pydev_2.6.0.2012062818/pysrc/pydev_imports.py", line 14, in <module>
        from _pydev_SimpleXMLRPCServer import SimpleXMLRPCServer
      File "/Users/someone/Desktop/eclipse/plugins/org.python.pydev_2.6.0.2012062818/pysrc/_pydev_SimpleXMLRPCServer.py", line 116, in <module>
        import BaseHTTPServer
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/BaseHTTPServer.py", line 81, in <module>
        import mimetools
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/mimetools.py", line 6, in <module>
        import tempfile
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tempfile.py", line 34, in <module>
        from random import Random as _Random
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/random.py", line 47, in <module>
        from os import urandom as _urandom
    ImportError: cannot import name urandom
回声$ PATH给了我这个。 /Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

我的目标是设置一个IDE,它给我代码完成和断点调试(比如java,这样我就可以逐行调试)。我在这里阅读了很多帖子,但仍未找到解决方案。谁能指向正确的方向?提前谢谢。

编辑: 我将python升级到2.7.3,因为我无法在eclipse首选项中选择解释器。

1 个答案:

答案 0 :(得分:1)

看看这个link。您需要做的就是对您的口译员进行适当的配置 如果它没有用,你应该看看another one(第二个是关于urandom模块,而第一个关于pydev配置。)