您的位置:首页 > 编程语言 > Python开发

Python 无法显示行号(下)

2015-07-14 21:19 821 查看

安装 IDLEX

IDLEX 是 IDLE 的扩展增强版,项目地址http://idlex.sourceforge.net/about.html

下载后运行
idlex.py
会弹出
Dos
报错:

[code]NameError: name 'channels' is not defined


错误全部信息如下:

[code]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


* 出错原因是没安装
IPython
*

安装 setuptools

参考https://pypi.python.org/pypi/setuptools

PowerShell
中输入

[code]> (Invoke-WebRequest https://bootstrap.pypa.io/ez_setup.py).Content | python -


C盘用户目录会出现安装包

[code]> (Invoke-WebRequest https://bootstrap.pypa.io/ez_setup.py).Content | python - --user




可以看到系统自动将
setuptool-18.0.1
安装到了
E:\python
所在目录中

这是因为在安装
python
时,已经在环境变量中加入了
E:\python


安装 IPython

直接在
PowerShell
中运行

[code]pip install ipython




再回过头来运行
idlex.py
,弹出DOS 窗口出现新的错误

[code]ImportError: IPython.kernel.zmq requires pyzmq >= 2.1.11


可以通过

PowerShell
中运行
pip install pyzmq
或者
easy_install pyzmq


[code]Traceback (most recent call last):
  File "E:\py_code\idlex-1.12\idlexlib\extensionManager.py", line 131, in load_e
xtension
    mod = importlib.import_module('.' + fullname, package=__package__)
  File "E:\Python\lib\importlib\__init__.py", line 37, in import_module
    __import__(name)
  File "E:\py_code\idlex-1.12\idlexlib\extensions\IPyIDLE.py", line 253, in <mod
ule>
    class IdleXSubSocketChannel(SimpleChannel, channels.IOPubChannel):
AttributeError: 'module' object has no attribute 'IOPubChannel'
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: