在python中使用jython ez_setup.py时出错

时间:2015-09-02 16:18:50

标签: jython

Jython新手。
我跟随How can I install various Python libraries in Jython?使用$ jython ez_setup.py,但以此错误结束

Traceback (innermost last):
File "ez_setup.py", line 278, in ?
File "ez_setup.py", line 210, in main
File "ez_setup.py", line 139, in download_setuptools
ImportError: no module named distutils

我从这里http://peak.telecommunity.com/dist/ez_setup.py下载ez_setup.py。我已经在http://www.jython.org/archive/22/installation.html

的指导下安装了jython

提前谢谢你们。

1 个答案:

答案 0 :(得分:0)

您的Jython版本似乎没有distutils。从您提供的链接看起来您正在使用Jython2.2,当我启动Jython2.2.1并尝试导入distutils时,我还得到ImportError

Jython 2.2.1 on java1.7.0_79
Type "copyright", "credits" or "license" for more information.
>>> import distutils
Traceback (innermost last):
  File "<console>", line 1, in ?
ImportError: no module named distutils
>>>

在更新版本的Jython上,distutils模块成功导入:

Jython 2.7b2 (default:a5bc0032cf79+, Apr 22 2014, 21:20:17) 
[Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.8.0_60
Type "help", "copyright", "credits" or "license" for more information.
>>> import distutils
>>>

您是否有必要使用旧版本的Jython?