Python 无法显示行号(下)

来源:互联网 发布:上海数据港国家战略 编辑:程序博客网 时间:2024/06/01 19:41

安装 IDLEX

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

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

NameError: name 'channels' is not defined

错误全部信息如下:

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 definedcould not load IPyIDLE

* 出错原因是没安装IPython *

安装 setuptools

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

PowerShell中输入

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

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

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

这里写图片描述

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

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

安装 IPython

直接在PowerShell中运行

pip install ipython

这里写图片描述

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

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

可以通过

PowerShell中运行 pip install pyzmq 或者 easy_install pyzmq

Traceback (most recent call last):  File "E:\py_code\idlex-1.12\idlexlib\extensionManager.py", line 131, in load_extension    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 <module>    class IdleXSubSocketChannel(SimpleChannel, channels.IOPubChannel):AttributeError: 'module' object has no attribute 'IOPubChannel'
0 0
原创粉丝点击