# "Jyni" with Python mode

**URL:** <https://discourse.processing.org/t/jyni-with-python-mode/14548>\
**Category:** Processing.py\
**Created:** [October 9, 2019, 2:21pm UTC](https://discourse.processing.org/t/jyni-with-python-mode/14548 "2019-10-09T14:21:05Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![solub](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/solub/32/333_2.png) [@solub](https://discourse.processing.org/u/solub)\
**Post date:** [October 9, 2019, 2:21pm UTC](https://discourse.processing.org/t/jyni-with-python-mode/14548/1 "2019-10-09T14:21:05Z")

</div>

Dear all,

I have recently heard about [Jyni](https://jyni.org/) (tries to enable Jython to use native CPython extensions) and would like to test it with Python mode.

I have 2 questions:

- Do you think it is compatible with Processing ? (latest version requires Jython 2.7.1)
- If so, how would you install it ?

Regarding the installation, the dedicated [github page](https://github.com/Stewori/JyNI/blob/master/README.md#3-installing-jyni) states the following:

- make the folder `JyNI.dll` available on the Java classpath
- have the `JyNI.jar` file on the Java classpath when calling Jython

Unfortunately, I have no understanding of how works the Java classpath (how to access and modify it) and would really appreciate your help.

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [October 9, 2019, 2:40pm UTC](https://discourse.processing.org/t/jyni-with-python-mode/14548/2 "2019-10-09T14:40:38Z")

</div>

Processing’s Python Mode is highly customized. So you should directly ask jdf for it: 😳

> **[jdf/processing.py](https://github.com/jdf/processing.py/issues)**
>
> Write Processing sketches in Python. Contribute to jdf/processing.py development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [October 9, 2019, 3:47pm UTC](https://discourse.processing.org/t/jyni-with-python-mode/14548/3 "2019-10-09T15:47:59Z")

</div>

> <https://github.com/jdf/processing.py/issues/351>
>
> Dear @jdf ,
> People on the Processsing forum suggested you would be the best placed to answer my question, so here I...

---

<div class="post-metadata">

**Author:** ![solub](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/solub/32/333_2.png) [@solub](https://discourse.processing.org/u/solub)\
**Post date:** [October 19, 2019, 5:12pm UTC](https://discourse.processing.org/t/jyni-with-python-mode/14548/4 "2019-10-19T17:12:44Z")

</div>

JFD is probably too busy to look at this issue. I’m a bit confused now and don’t really know where to ask for help. Folks from “Jyni” probably won’t have any clue as it is related to the Processing environment and at the same time this is too specific/technical to be asked on this forum (Python mode, Java classpath, Jython compatibilty…). SO doesn’t seem to be the best place either.

---

<div class="post-metadata">

**Author:** ![villares](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/villares/32/3166_2.png) [@villares](https://discourse.processing.org/u/villares)\
**Post date:** [October 22, 2019, 7:18pm UTC](https://discourse.processing.org/t/jyni-with-python-mode/14548/5 "2019-10-22T19:18:14Z")

</div>

Yet another crazy idea… Maybe you could create a PyJnius interface to Processing…

Use vanilla CPython + PyJnius to acesss and run PApplet (sketch) objects…

[https://pyjnius.readthedocs.io/en/stable/index.html](https://pyjnius.readthedocs.io/en/stable/index.html)

---

<div class="post-metadata">

**Author:** ![solub](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/solub/32/333_2.png) [@solub](https://discourse.processing.org/u/solub)\
**Post date:** [October 23, 2019, 7:29pm UTC](https://discourse.processing.org/t/jyni-with-python-mode/14548/6 "2019-10-23T19:29:54Z")

</div>

Thank you for the suggestion.

I like crazy ideas, and this one is pretty interesting but I’m afraid this is way beyond my current level of capability.

---

<div class="post-metadata">

**Author:** ![solub](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/solub/32/333_2.png) [@solub](https://discourse.processing.org/u/solub)\
**Post date:** [October 27, 2019, 4:48pm UTC](https://discourse.processing.org/t/jyni-with-python-mode/14548/7 "2019-10-27T16:48:27Z")

</div>

@GoToLoop, do you know how to make the `dll` and `jar` file available on the Java classpath ?  
I have spent quite some time trying to figure this out without success. All I could do so far (please don’t laugh) is to drop

- _JyNI.jar_ in `C:\Program Files (x86)\Java\jre1.8.0_211\lib`
- _JyNI.dll_ in `C:\Program Files (x86)\Java\jre1.8.0_211\bin`

and in Processing Python mode:

```auto
import sys
sys.path.append('C:/Python27/Lib/site-packages')

import numpy as np #one day, let's hope

```

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [October 28, 2019, 12:13am UTC](https://discourse.processing.org/t/jyni-with-python-mode/14548/8 "2019-10-28T00:13:31Z")

</div>

Sorry, that is all a mystery to me, b/c I’ve never looked into the subject yet. 😿

Python Mode got 3 JAR files at “sketchbook.path.three”\modes\PythonMode\mode\ :

1. PythonMode.jar
2. jython.jar
3. guava-17.0.jar

Most probably the file JyNI.jar & folder JyNI.dll\ should both go there as well.

However, they still need to be activated by making the JVM see they’re there.

That is, we have to somehow include them as part of the class path loading step, the same way jython.jar and other “.jar” files already are.

---

<div class="post-metadata">

**Author:** ![solub](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/solub/32/333_2.png) [@solub](https://discourse.processing.org/u/solub)\
**Post date:** [October 28, 2019, 10:47pm UTC](https://discourse.processing.org/t/jyni-with-python-mode/14548/9 "2019-10-28T22:47:34Z")

</div>

> <https://github.com/Stewori/JyNI/issues/36>
>
> Dear @Stewori ,
> Thank you for the clarifications provided on the Processing.py git thread.
> I (and some other folks from the Processing community)...
