jython.exe"2.7.0最终版本"在Windows操作系统上执行失败 [英] jython.exe "2.7.0 final release" failed execution on my Windows OS

查看:255
本文介绍了jython.exe"2.7.0最终版本"在Windows操作系统上执行失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

操作系统:Windows 7,64位

OS: Windows 7, 64-bit

在这里,我了解到最新版本Jython的版本(下载/安装为"2.7.0")包括"ensurepip"模块,希望可以安装pip.

Here I learn that the latest version of Jython (downloads/installs as "2.7.0") includes the "ensurepip" module, which hopefully installs pip.

这就是我得到的...注意,我的机器上没有驱动器"Z:"

This is what I get... NB there is no drive "Z:" on my machine

D:\apps\jython2.7.0\bin>jython -m ensurepip
Traceback (most recent call last):
  File "<string>", line 444, in <module>
  File "<string>", line 435, in main
  File "Z:\jythondev\jython27\src\shell\build\jython\out00-PYZ.pyz\subprocess",
line 522, in call
  File "Z:\jythondev\jython27\src\shell\build\jython\out00-PYZ.pyz\subprocess",
line 710, in __init__
  File "Z:\jythondev\jython27\src\shell\build\jython\out00-PYZ.pyz\subprocess",
line 958, in _execute_child
WindowsError: [Error 2] The system cannot find the file specified

实际上,如果我只是输入"jython" [返回],就会出现上述错误!

In fact I get the above error if I simply enter "jython" [Return]!

在readme.txt文件中,我看到以下内容:

In the readme.txt file I see this:

这是2.7.0版本的Jython的最终版本.随着 语言和运行时与CPython 2.7.0,Jython 2.7的兼容性 提供了对Python生态系统的实质性支持.这包括 内置的pip/setuptools支持(可以与bin/pip一起使用)和 Windows的本机启动器(bin/jython.exe),其含义是 您最终可以在Windows上安装Jython脚本.

This is the final release of the 2.7.0 version of Jython. Along with language and runtime compatibility with CPython 2.7.0, Jython 2.7 provides substantial support of the Python ecosystem. This includes built-in support of pip/setuptools (you can use with bin/pip) and a native launcher for Windows (bin/jython.exe), with the implication that you can finally install Jython scripts on Windows.

我不知道它们的含义是可以与bin/pip一起使用" ... bin目录(在Windoze上为\ bin)包含2个文件:jython.exe和python27.dll.

I have no idea what they mean by "you can use with bin/pip"... the bin directory (\bin on Windoze) contains 2 files: jython.exe and python27.dll.

此外,我不知道如何让Jython的交互式终端与此一起运行

Furthermore I don't know how to get the interactive terminal for Jython running with this

15分钟后 2票!我没想到这一点.我认为这可能是我在机器上做过的异常事情的罪魁祸首.现在,我开始怀疑Jython团队(顺便说说是天才)是否对Windoze盒子不感兴趣,以至于他们只是将其包装并扔到那里而根本没有在任何Windoze盒子上进行测试!

15 mins later 2 up votes! I wasn't expecting that. I thought it was likely something anomalous I had done on my machine was to blame. Now I'm beginning to wonder whether the Jython team (who are geniuses by the way) are just so uninterested in Windoze boxes that they just packaged this up and flung it out there without testing it on any Windoze boxes at all!

几天后 遵循吉姆·贝克(Jim Baker)的建议:完美平滑的安装. 点安装"工作正常!

a few days later Followed Jim Baker's advice: perfectly smooth installation. "pip install" working fine!

推荐答案

JAVA_HOME必须设置为%JAVA_HOME%\bin\java.exe是Java可执行文件,而目标java.exe必须是Java7.请参见

JAVA_HOME must be set such that %JAVA_HOME%\bin\java.exe is the Java executable, and the target java.exe must be Java 7. See this Jython bug. It is important to note that some other possible settings for that environment variable do not work - we expect that bin\java.exe can be joined to JAVA_HOME (using os.path.join to be precise). Also it is important to set JAVA_HOME exactly per what Windows expects in terms of quoting, etc:

set JAVA_HOME=C:\Program Files\Java\jdk1.7.0_55

set JAVA_HOME=C:\Program Files\Java\jdk1.7.0_55

但不是

set JAVA_HOME="C:\Program Files\Java\jdk1.7.0_55"

set JAVA_HOME="C:\Program Files\Java\jdk1.7.0_55"

(完全不一样!试一试,看看我的意思.)

(Not at all the same! Just try it to see what I mean.)

调试这些问题的最简单方法是使用jython --print;.例如,在我的系统上,我得到以下信息:

The easiest way to debug these problems is with jython --print; for example on my system I get the following:

C:\jython2.7.0>set JAVA_HOME=C:\Program Files\Java\jdk1.7.0_55 C:\jython2.7.0>bin\jython.exe --print "C:\Program Files\Java\jdk1.7.0_55\bin\java" -Xmx512m -Xss1024k -classpath C:\jython2.7.0\jython.jar;. -Dpython.home=C:\jython2.7.0 -Dpython.executable=C:\jython2.7.0\bin\jython.exe -Dpython.launcher.uname=windows -Dpython.launcher.tty=true org.python.util.jython

C:\jython2.7.0>set JAVA_HOME=C:\Program Files\Java\jdk1.7.0_55 C:\jython2.7.0>bin\jython.exe --print "C:\Program Files\Java\jdk1.7.0_55\bin\java" -Xmx512m -Xss1024k -classpath C:\jython2.7.0\jython.jar;. -Dpython.home=C:\jython2.7.0 -Dpython.executable=C:\jython2.7.0\bin\jython.exe -Dpython.launcher.uname=windows -Dpython.launcher.tty=true org.python.util.jython

接下来让我解释一下您看到的不透明错误.有两件事发生:

Let me next explain the opaque error you are seeing. There are two things going on:

  1. jython.exe实际上是Jython启动器;在jython --print的输出中可以看到我们使用的真正的Jython;它是org.python.util.jython,外加许多其他选项.但是我们需要一个exe文件,以便pip和其他工具可以正常工作.在Windows上(或在其他OS上(例如,如果启用了概要分析的话)),启动器使用子进程来调用Java可执行文件.该子流程调用位于jython.py的第435行.

  1. jython.exe is actually the Jython launcher; the real Jython we use is seen in the output of jython --print; it is org.python.util.jython, plus a bunch of other options. But we need an exe so that pip and other tooling can work. On Windows (or on other OSes if profiling for example is turned on), the launcher uses subprocess to invoke the Java executable. This subprocess invocation is in line 435 of jython.py.

是的,那是jython.py.它实际上使用CPython 2.7(感谢您使用CPython,我们喜欢您!),并由包裹在可执行文件中. PyInstaller .关于"Z:\ jythondev \ jython27 \ src \ shell \ build \ jython \ out00-PYZ.pyz \ subprocess"的全部内容, 这是由于我在Z:驱动器上构建了jython.exe,在VMWare上安装的Windows 8.1已将其OS X homedir映射到该驱动器上. (是的,我完全负责这个构建.)接下来,out00-PYZ.pyz引用了PyInstaller使用的一些内部方案.

Yes, that's jython.py. It actually uses CPython 2.7 (thanks for being around CPython, we like you!), and is wrapped into an executable by PyInstaller. The whole thing about "Z:\jythondev\jython27\src\shell\build\jython\out00-PYZ.pyz\subprocess", is due to the fact that I built jython.exe on my Z: drive, onto which my install of Windows 8.1 on VMWare has mapped my OS X homedir. (Yes, I'm completely responsible for this build.) Next, out00-PYZ.pyz refers to some internal scheme used by PyInstaller.

我们需要完成我在该错误中提到的发行说明Wiki更新!并且当然可以修复该错误,以便它提供更好的错误消息,并且在某些情况下可以恢复.

We need to complete the release notes wiki update I mention on that bug! And of course fix that bug so it provides a better error message and possibly can recover in certain cases.

这篇关于jython.exe"2.7.0最终版本"在Windows操作系统上执行失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆