python - 回溯错误 : Does idlex need to be installed in a particular location?

标签 python python-2.7 ide

我正在运行Python-2.7.8.AMD64,并在 friend 的建议下安装了idlex。

当我使用快捷方式启动idlex时,会弹出一个Dos框,其中包含一个Traceback,如所附代码框中所示。

idlex.py - Shortcut

Traceback (most recent call last):
  File "C:\downloads\python\idlex-1.12\idlexlib\extensionManager.py", line 131,
in load_extension
    mod = importlib.import_module('.' + fullname, package=__package__)
  File "C:\Python27\lib\importlib\__init__.py", line 37, in import_module
    __import__(name)
  File "C:\downloads\python\idlex-1.12\idlexlib\extensions\IPyIDLE.py", line 253
, in <module>
    class IdleXSubSocketChannel(SimpleChannel, channels.IOPubChannel):
NameError: name 'channels' is not defined
could not load IPyIDLE

我不确定这意味着什么。

idlex 按预期运行,没有我可以确定的明显错误。

idlex 是否需要安装在与 Python 相关的特定位置才能消除此错误? (即在 Lib 中的 python 文件夹中?)

谢谢。

最佳答案

您似乎缺少 IPython。

您可以执行pip install ipythoneasy_install ipython,请参阅here如果您需要帮助。

该错误是一个 NameError,表示它没有变量 channels 的定义,该变量是由依赖于 IPython 的“idlex-1.12/idlex1.12/”中的导入调用的。 idlexlib/extension/IPyIDLE.py":

if HAS_IPYTHON:
# IPython
...
import IPython.kernel.channels as channels
...

发生错误的位置位于文件的更下方:

class IdleXSubSocketChannel(SimpleChannel, channels.IOPubChannel):
     channel_name = 'sub'

一旦安装了 IPython,该错误就解决了,但是随后您将遇到另一个错误(如果您有基本安装):

ImportError: IPython.kernel.zmq requires pyzmq >= 2.1.11

这可以通过 pip install pyzmqeasy_install pyzmq 来解决,完成后,IdleX 应该运行而不会向您抛出错误。

关于python - 回溯错误 : Does idlex need to be installed in a particular location?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26512054/

相关文章:

python - python 2.7.3 和 python 3.3 之间的区别

Python Pandas - 使用另一个数据框列的值更新数据框列

python - 似乎append()添加了变量而不是它们的值

python - pip install MySQL-python,命令 "python setup.py egg_info"失败,错误代码为 1

java - 如何检查 Codenvy 生成的 java WAR 文件?

scala - 为什么使用 scala repl 而不是工作表?

python - 如何在交互式 shell 中加载 python 脚本

python - 使用 turtle 图形和递归的希尔伯特曲线

python - 如何在python中为接口(interface)分配IP地址?

java - Eclipse 不会检查我的代码中的错误 (Java EE)