jython / jython3 Goto Github PK
View Code? Open in Web Editor NEWA sandboxed attempt at v3 (not maintained)
License: Other
A sandboxed attempt at v3 (not maintained)
License: Other
java.lang.NoClassDefFoundError: org.python.antlr.NoCloseReaderStream
at org.python.core.ParserFacade.parse(ParserFacade.java:112)
at org.python.core.Py.compile_flags(Py.java:1669)
at org.python.core.__builtin__.execfile_flags(__builtin__.java:570)
at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:145)
at com.example.android.home_automation.Text_processing.str(Text_processing.java:113)
at com.example.android.home_automation.MainActivity.onActivityResult(MainActivity.java:75)
at android.app.Activity.dispatchActivityResult(Activity.java:6508)
at android.app.ActivityThread.deliverResults(ActivityThread.java:3734)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:3781)
at android.app.ActivityThread.access$1500(ActivityThread.java:153)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1424)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:5523)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629)
java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: org.python.antlr.NoCloseReaderStream
at android.app.ActivityThread.deliverResults(ActivityThread.java:3738)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:3781)
at android.app.ActivityThread.access$1500(ActivityThread.java:153)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1424)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:5523)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629)
Caused by: Traceback (most recent call last):
(no code object) at line 0
java.lang.NoClassDefFoundError: org.python.antlr.NoCloseReaderStream
at org.python.core.ParserFacade.parse(ParserFacade.java:112)
at org.python.core.Py.compile_flags(Py.java:1669)
at org.python.core.__builtin__.execfile_flags(__builtin__.java:570)
at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:145)
at com.example.android.home_automation.Text_processing.str(Text_processing.java:113)
at com.example.android.home_automation.MainActivity.onActivityResult(MainActivity.java:75)
at android.app.Activity.dispatchActivityResult(Activity.java:6508)
at android.app.ActivityThread.deliverResults(ActivityThread.java:3734)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:3781)
at android.app.ActivityThread.access$1500(ActivityThread.java:153)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1424)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:5523)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629)
java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: org.python.antlr.NoCloseReaderStream
Caused by: java.lang.NoClassDefFoundError: org.python.antlr.NoCloseReaderStream
at org.python.core.ParserFacade.parse(ParserFacade.java:112)
at org.python.core.Py.compile_flags(Py.java:1669)
at org.python.core.__builtin__.execfile_flags(__builtin__.java:570)
at org.python.util.PythonInterpreter.execfile(Pyt
01-13 12:39:34.748 27424-27424/com.example.android.home_automation E/MQSEventManagerDelegate: failed to get MQSService.
https://github.com/securesystemslab/zippy
zippy is also an effort to implement python 3.x on top of JVM.
May be, you people can formally invite them to join your team too
So that this port can be completed
Hi, it's not clear from just examining the files in the repo how to build the code. There is a build.xml, so ant? Then there is also a maven directory, but with no fully formed pom in it. Can you clarify how to go about building the code and run the tests?
Or "abandoned"
The last update was three years ago. Does that mean that the update has stopped?
I'm parsing the following file:
import tensorflow as tf
def add(a, b):
return a + b
c = add(tf.ones([1, 2]), tf.ones([2, 2])) # [[2., 2.], [2., 2.]]
When we get to parameter a
, I see the CommonToken
representing a
as follows:
[@12,33:33='a',<63>,3:8]
Particularly, charPositionInLine
for a
is 8, but it should be 9. Also, there's one character, so we should see 33:34
as the start and end column.
I clone this repository, but i don't understand how to install Jython 3 on my PC
As the title shows
Log
expose:
[expose] Exposing 219 classes
jar:
[jar] Building jar: G:\jython3\jython3\dist\callbacker_test.jar
[jar] Building jar: G:\jython3\jython3\dist\jython-dev.jar
copy-javalib:
[copy] Copying 57 files to G:\jython3\jython3\dist\javalib
copy-cpythonlib:
[copy] Copying 1210 files to G:\jython3\jython3\dist\Lib
copy-lib:
[copy] Copying 500 files to G:\jython3\jython3\dist\Lib
[copy] Copying 4 files to G:\jython3\jython3\dist\bin
[copy] Copying 1 file to G:\jython3\jython3\dist
pycompile:
[jycompile] Compiling 515 files
[jycompile] java.lang.Exception: Unhandled node YieldFrom
[jycompile]
[jycompile] at org.python.compiler.CodeCompiler.unhandled_node(CodeCompiler.
java:2885)
[jycompile]
[jycompile] at org.python.antlr.ast.VisitorBase.visitYieldFrom(VisitorBase.j
ava:269)
[jycompile]
[jycompile] at org.python.antlr.ast.YieldFrom.accept(YieldFrom.java:118)
[jycompile]
[jycompile] at org.python.antlr.Visitor.visit(Visitor.java:26)
[jycompile]
[jycompile] at org.python.compiler.CodeCompiler.visitExpr(CodeCompiler.java:
563)
[jycompile]
[jycompile] at org.python.antlr.ast.Expr.accept(Expr.java:118)
[jycompile]
[jycompile] at org.python.antlr.Visitor.visit(Visitor.java:26)
[jycompile]
[jycompile] at org.python.compiler.CodeCompiler.suite(CodeCompiler.java:1472
)
[jycompile]
[jycompile] at org.python.compiler.CodeCompiler.doTest(CodeCompiler.java:112
4)
[jycompile]
[jycompile] at org.python.compiler.CodeCompiler.visitIf(CodeCompiler.java:11
46)
[jycompile]
[jycompile] at org.python.antlr.ast.If.accept(If.java:197)
[jycompile]
[jycompile] at org.python.antlr.Visitor.visit(Visitor.java:26)
[jycompile]
[jycompile] at org.python.compiler.CodeCompiler.suite(CodeCompiler.java:1472
)
[jycompile]
[jycompile] at org.python.compiler.CodeCompiler.doTest(CodeCompiler.java:112
4)
[jycompile]
[jycompile] at org.python.compiler.CodeCompiler.visitIf(CodeCompiler.java:11
46)
[jycompile]
[jycompile] at org.python.antlr.ast.If.accept(If.java:197)
[jycompile]
[jycompile] at org.python.antlr.Visitor.visit(Visitor.java:26)
[jycompile]
[jycompile] at org.python.compiler.CodeCompiler.suite(CodeCompiler.java:1472
)
[jycompile]
[jycompile] at org.python.compiler.CodeCompiler.visitSuite(CodeCompiler.java
:1467)
[jycompile]
[jycompile] at org.python.antlr.ast.Suite.accept(Suite.java:122)
[jycompile]
[jycompile] at org.python.antlr.Visitor.visit(Visitor.java:26)
[jycompile]
[jycompile] at org.python.compiler.CodeCompiler.parse(CodeCompiler.java:318)
[jycompile]
[jycompile] at org.python.compiler.Module.codeConstant(Module.java:517)
[jycompile]
[jycompile] at org.python.compiler.Module.codeConstant(Module.java:501)
[jycompile]
[jycompile] at org.python.compiler.CodeCompiler.visitFunctionDef(CodeCompile
r.java:513)
[jycompile]
[jycompile] at org.python.antlr.ast.FunctionDef.accept(FunctionDef.java:219)
[jycompile]
[jycompile] at org.python.antlr.ast.Module.traverse(Module.java:129)
[jycompile]
[jycompile] at org.python.antlr.Visitor.traverse(Visitor.java:12)
[jycompile]
[jycompile] at org.python.compiler.CodeCompiler.visitModule(CodeCompiler.jav
a:368)
[jycompile]
[jycompile] at org.python.antlr.ast.Module.accept(Module.java:122)
[jycompile]
[jycompile] at org.python.antlr.Visitor.visit(Visitor.java:26)
[jycompile]
[jycompile] at org.python.compiler.CodeCompiler.parse(CodeCompiler.java:318)
[jycompile]
[jycompile] at org.python.compiler.Module.codeConstant(Module.java:517)
[jycompile]
[jycompile] at org.python.compiler.Module.codeConstant(Module.java:501)
[jycompile]
[jycompile] at org.python.compiler.Module.compile(Module.java:673)
[jycompile]
[jycompile] at org.python.core.imp.compileSource(imp.java:367)
[jycompile]
[jycompile] at org.python.core.imp.compileSource(imp.java:294)
[jycompile]
[jycompile] at org.python.core.imp.compileSource(imp.java:285)
[jycompile]
[jycompile] at org.python.core.imp.compileSource(imp.java:281)
[jycompile]
[jycompile] at org.python.util.JycompileAntTask.compile(JycompileAntTask.jav
a:55)
[jycompile]
[jycompile] at org.python.util.JycompileAntTask.process(JycompileAntTask.jav
a:39)
[jycompile]
[jycompile] at org.python.util.GlobMatchingTask.execute(GlobMatchingTask.jav
a:70)
[jycompile]
[jycompile] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.ja
va:293)
[jycompile]
[jycompile] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[jycompile]
[jycompile] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
hodAccessorImpl.java:43)
[jycompile]
[jycompile] at java.lang.reflect.Method.invoke(Method.java:606)
[jycompile]
[jycompile] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchU
tils.java:106)
[jycompile]
[jycompile] at org.apache.tools.ant.Task.perform(Task.java:348)
[jycompile]
[jycompile] at org.apache.tools.ant.Target.execute(Target.java:435)
[jycompile]
[jycompile] at org.apache.tools.ant.Target.performTasks(Target.java:456)
[jycompile]
[jycompile] at org.apache.tools.ant.Project.executeSortedTargets(Project.jav
a:1405)
[jycompile]
[jycompile] at org.apache.tools.ant.Project.executeTarget(Project.java:1376)
[jycompile]
[jycompile] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(De
faultExecutor.java:41)
[jycompile]
[jycompile] at org.apache.tools.ant.Project.executeTargets(Project.java:1260
)
[jycompile]
[jycompile] at org.apache.tools.ant.Main.runBuild(Main.java:853)
[jycompile]
[jycompile] at org.apache.tools.ant.Main.startAnt(Main.java:235)
[jycompile]
[jycompile] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:285)
[jycompile]
[jycompile] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:112)
[jycompile]
[jycompile]
[jycompile] java.lang.Exception: java.lang.Exception: Unhandled node YieldFrom
[jycompile] Could not compile G:\jython3\jython3\dist\Lib\glob.py
BUILD FAILED
G:\jython3\jython3\build.xml:800: Compile failed; see the compiler error output
for details.
Total time: 6 minutes 43 seconds
G:\jython3\jython3>cd G:\jython3\jython3\dist
G:\jython3\jython3\dist>cd G:\jython3\jython3\dist\bin
G:\jython3\jython3\dist\bin>jython
Exception in thread "main" File "G:\jython3\jython3\dist\Lib\site.py", line 44
7
print self.__lines[i]
^
SyntaxError: no viable alternative at input 'self'
G:\jython3\jython3\dist\bin>cd ./
G:\jython3\jython3\dist\bin>cd .
G:\jython3\jython3\dist\bin>cd ../
G:\jython3\jython3\dist>java jython-dev.jar
Error: Could not find or load main class jython-dev.jar
site.py is python 2 ?
Here's what I'm getting
$ ./dist/bin/jython -vvv
initializer: 'META-INF/services/org.python.core.JythonInitializer' not found on sun.misc.Launcher$AppClassLoader@42a57993
initializer: 'META-INF/services/org.python.core.JythonInitializer' not found on sun.misc.Launcher$AppClassLoader@42a57993
Exception in thread "main"
Exception: org.python.core.PyException thrown from the UncaughtExceptionHandler in thread "main"
Here is a stacktrace from jdb:
[1] org.python.core.PyException.printStackTrace (PyException.java:110)
[2] org.python.core.PyException.toString (PyException.java:127)
[3] org.python.core.Py.importSiteIfSelected (Py.java:1,764)
[4] org.python.util.PythonInterpreter.<init> (PythonInterpreter.java:113)
[5] org.python.util.PythonInterpreter.<init> (PythonInterpreter.java:91)
[6] org.python.util.InteractiveInterpreter.<init> (InteractiveInterpreter.java:39)
[7] org.python.util.InteractiveInterpreter.<init> (InteractiveInterpreter.java:28)
[8] org.python.util.InteractiveConsole.<init> (InteractiveConsole.java:68)
[9] org.python.util.InteractiveConsole.<init> (InteractiveConsole.java:54)
[10] org.python.util.InteractiveConsole.<init> (InteractiveConsole.java:34)
[11] org.python.util.jython.run (jython.java:276)
[12] org.python.util.jython.main (jython.java:142)
I compiled it successfully after the following modifications
@@ -501,6 +510,9 @@
<exclude name="**/handler/InformixDataHandler.java" unless="informix.present" />
<exclude name="**/handler/OracleDataHandler.java" unless="oracle.present" />
<classpath refid="main.classpath" />
+ <classpath>
+ <pathelement path="/Users/Sohail/.m2/repository/com/jcraft/jzlib/1.1.3/jzlib-1.1.3.jar" />
+ </classpath>
</javac>
Anyone know what's going on? Or how to go about debugging it?
My machine.
Intel Core I5 2.5 GHZ, 16 GB Memory, running on OS X 10.9.5
The resulting class should probably be called PyLong as in CPython API; this would also aid in porting libraries to Jython 3.
How to build jython3 project to .jar or where can I find this .jar
thus 0o123 is fine, but 0123 should raise syntax error now.
In jython3 have https://github.com/jython/jython3/blob/master/.travis.yml , but jython3 not enable travis.
Python 3.4.3 (default, Mar 26 2015, 22:03:40)
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> ...
Ellipsis
the except Foo, bar
should be removed.
jython有没有能支持android的呀 或者改一改jython的源码让它支持android jython开源的吗 源码哪里看呢
I found a mercurial repository https://hg.python.org/jython/
The git repository is not updated?
The resulting class could be called PyUnicode, as in CPython.
java -jar c:\jython2.7.0\jython.jar test.py
File "C:\Users\Rakesh\Desktop\test.py", line 7, in
import gitdb
File "C:\Python27\Lib\site-packages\gitdb__init__.py", line 26, in
init_externals()
File "C:\Python27\Lib\site-packages\gitdb__init_.py", line 20, in _init_externals
raise ImportError("'%s' could not be imported, assure it is located in your PYTHONPATH" % module)
ImportError: 'smmap' could not be imported, assure it is located in your PYTHONPATH
Code snippet :
import sys
sys.path.append("C:\Python27\Lib\site-packages")
sys.path.append("C:\Python27\Lib")
import gitdb
If I try the same in python it works fine but running through jython give me the above error, can you please help me out what is the problem?
After git clone
ing the repository and cd
ing to it, what do I run next?
In Python 3, b'' results in AST tree Bytes(s=b'')
I was looking for a solution to using mixed python and java, but required python 3 for my company project. When I started work on the project last spring, this project looked like a long road so I decided to use jpype. I figured that this project would catch up eventually. But since then it appears this project has completely stalled.
Is there a road map or a task list with things that contributors can do to get this project back to moving? Or has it died completely? What level of push is required to get a beta for python3?
Dear all old buddy , where can i find the most advanced and stable version jython?
Copy the code below to test.py and run it
from javafx.scene.control import TabPane
print("Ok")
It returns an error saying:
java.lang.ExceptionInInitializerError
Caused by: java.lang.IllegalStateException: Toolkit not initialized
Complete Error report:
Traceback (most recent call last):
File "test.py", line 1, in <module>
from javafx.scene.control import TabPane
java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.python.core.Py.loadAndInitClass(Py.java:991)
at org.python.core.Py.findClassInternal(Py.java:926)
at org.python.core.Py.findClassEx(Py.java:977)
at org.python.core.packagecache.SysPackageManager.findClass(SysPackageManager.java:133)
at org.python.core.packagecache.PackageManager.findClass(PackageManager.java:33)
at org.python.core.packagecache.SysPackageManager.findClass(SysPackageManager.java:122)
at org.python.core.PyJavaPackage.__findattr_ex__(PyJavaPackage.java:134)
at org.python.core.PyObject.__findattr__(PyObject.java:946)
at org.python.core.imp.importFromAs(imp.java:1160)
at org.python.core.imp.importFrom(imp.java:1132)
at org.python.pycode._pyx0.f$0(test.py:3)
at org.python.pycode._pyx0.call_function(test.py)
at org.python.core.PyTableCode.call(PyTableCode.java:167)
at org.python.core.PyCode.call(PyCode.java:18)
at org.python.core.Py.runCode(Py.java:1386)
at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:296)
at org.python.util.jython.run(jython.java:362)
at org.python.util.jython.main(jython.java:142)
Caused by: java.lang.IllegalStateException: Toolkit not initialized
at com.sun.javafx.application.PlatformImpl.runLater(PlatformImpl.java:273)
at com.sun.javafx.application.PlatformImpl.runLater(PlatformImpl.java:268)
at com.sun.javafx.application.PlatformImpl.setPlatformUserAgentStylesheet(PlatformImpl.java:550)
at com.sun.javafx.application.PlatformImpl.setDefaultPlatformUserAgentStylesheet(PlatformImpl.java:512)
at javafx.scene.control.Control.<clinit>(Control.java:87)
... 20 more
java.lang.ExceptionInInitializerError: java.lang.ExceptionInInitializerError
Something is happening at import command that is generating this error.
As you can see at code, I am just importing but not using the imported class.
Added: I just noticed that the same error occurs when I try import Control directly.
Appears that the error are in creation of this class and classes that have Control as parent class, for any reason. By the other side, try to import classes that have Pane as parent works, even having Pane Control as his parent class. I don't know if this information helps.
Thanks for your help.
Jython version: 2.7.0
If this Issue was at wrong project please let me know where to put it. Thanks.
Zippy (https://github.com/securesystemslab/zippy) has Python 3 implemented on
Truffle framework (https://github.com/graalvm/truffle).
JRuby has Truffle with Sulong to run C extension
(http://chrisseaton.com/rubytruffle/llvm-cauldron-16/llvm-cauldron-sulong.pdf)
Is there any discussion on Jython following such path?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.