py5coding / py5generator

Meta-programming project that creates the py5 library code.
https://py5coding.org/
GNU General Public License v3.0
52 stars 13 forks source link

Trouble getting started with conda install #27

Closed villares closed 3 years ago

villares commented 3 years ago

I'm probably doing something wrong, please forgive me. I decided to try this instruction:

conda env create -n py5coding -f http://py5.ixora.io/install/py5_environment.yml

Then I tried running this example:

import py5

def setup():
    py5.size(200, 200)
    py5.rect_mode(py5.CENTER)

def draw():
    py5.rect(py5.mouse_x, py5.mouse_y, 10, 10)

py5.run_sketch()

So I've got this error (also, should conda have created a Python 3.9 env?):

Python 3.8.10 (/home/villares/miniconda3/envs/py5coding/bin/python3.8)
>>> %cd /home/villares/GitHub/python-play/py5_play
>>> %Run first_sketch.py
Traceback (most recent call last):
  File "org.jpype.manager.TypeManager.java", line -1, in org.jpype.manager.TypeManager.findClassByName
  File "org.jpype.manager.TypeManager.java", line -1, in org.jpype.manager.TypeManager.lookupByName
  File "Class.java", line 348, in java.lang.Class.forName
  File "Class.java", line -2, in java.lang.Class.forName0
  File "ClassLoader.java", line 351, in java.lang.ClassLoader.loadClass
  File "ClassLoader.java", line 405, in java.lang.ClassLoader.loadClass
  File "ClassLoader.java", line 405, in java.lang.ClassLoader.loadClass
  File "Launcher.java", line 352, in sun.misc.Launcher$AppClassLoader.loadClass
  File "ClassLoader.java", line 418, in java.lang.ClassLoader.loadClass
  File "URLClassLoader.java", line 362, in java.net.URLClassLoader.findClass
  File "AccessController.java", line -2, in java.security.AccessController.doPrivileged
  File "URLClassLoader.java", line 363, in java.net.URLClassLoader$1.run
  File "URLClassLoader.java", line 369, in java.net.URLClassLoader$1.run
  File "URLClassLoader.java", line 74, in java.net.URLClassLoader.access$100
  File "URLClassLoader.java", line 468, in java.net.URLClassLoader.defineClass
  File "SecureClassLoader.java", line 142, in java.security.SecureClassLoader.defineClass
  File "ClassLoader.java", line 756, in java.lang.ClassLoader.defineClass
  File "ClassLoader.java", line -2, in java.lang.ClassLoader.defineClass1
Exception: Java Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/villares/GitHub/python-play/py5_play/first_sketch.py", line 1, in <module>
    import py5
  File "/home/villares/miniconda3/envs/py5coding/lib/python3.8/site-packages/py5/__init__.py", line 49, in <module>
    from .methods import register_exception_msg  # noqa
  File "/home/villares/miniconda3/envs/py5coding/lib/python3.8/site-packages/py5/methods.py", line 131, in <module>
    class Py5Methods:
  File "/home/villares/miniconda3/envs/py5coding/lib/python3.8/site-packages/jpype/_jproxy.py", line 136, in JProxyCreator
    return _createJProxy(cls, *interfaces, **kwargs)
  File "/home/villares/miniconda3/envs/py5coding/lib/python3.8/site-packages/jpype/_jproxy.py", line 80, in _createJProxy
    actualIntf = _prepareInterfaces(cls, intf)
  File "/home/villares/miniconda3/envs/py5coding/lib/python3.8/site-packages/jpype/_jproxy.py", line 51, in _prepareInterfaces
    actualIntf = _convertInterfaces(intf)
  File "/home/villares/miniconda3/envs/py5coding/lib/python3.8/site-packages/jpype/_jproxy.py", line 156, in _convertInterfaces
    actualIntf.add(_jpype.JClass(item))
  File "/home/villares/miniconda3/envs/py5coding/lib/python3.8/site-packages/jpype/_jclass.py", line 99, in __new__
    return _jpype._getClass(jc)
java.lang.java.lang.UnsupportedClassVersionError: java.lang.UnsupportedClassVersionError: py5/core/Py5Methods has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

My conda reported this on env creation:

[villares@L340 ~]$ conda env create -n py5coding -f http://py5.ixora.io/install/py5_environment.yml
Collecting package metadata (repodata.json): done
Solving environment: done

==> WARNING: A newer version of conda exists. <==
  current version: 4.10.1
  latest version: 4.10.3

Please update conda by running

    $ conda update -n base conda

Downloading and Extracting Packages
requests-2.26.0      | 52 KB     | ##################################### | 100% 
bleach-3.3.1         | 111 KB    | ##################################### | 100% 
_libgcc_mutex-0.1    | 3 KB      | ##################################### | 100% 
prompt-toolkit-3.0.1 | 244 KB    | ##################################### | 100% 
pcre-8.45            | 253 KB    | ##################################### | 100% 
pip-21.1.3           | 1.1 MB    | ##################################### | 100% 
jupyterlab_server-2. | 44 KB     | ##################################### | 100% 
_openmp_mutex-4.5    | 22 KB     | ##################################### | 100% 
debugpy-1.4.0        | 2.0 MB    | ##################################### | 100% 
charset-normalizer-2 | 32 KB     | ##################################### | 100% 
packaging-21.0       | 35 KB     | ##################################### | 100% 
ipykernel-6.0.3      | 171 KB    | ##################################### | 100% 
nbconvert-6.1.0      | 521 KB    | ##################################### | 100% 
line_profiler-3.3.0  | 77 KB     | ##################################### | 100% 
pandoc-2.14.1        | 12.0 MB   | ##################################### | 100% 
python-dateutil-2.8. | 240 KB    | ##################################### | 100% 
ipython-7.25.0       | 1.1 MB    | ##################################### | 100% 
python_abi-3.8       | 4 KB      | ##################################### | 100% 
terminado-0.10.1     | 26 KB     | ##################################### | 100% 
send2trash-1.7.1     | 17 KB     | ##################################### | 100% 
xorg-libx11-1.7.2    | 941 KB    | ##################################### | 100% 
urllib3-1.26.6       | 99 KB     | ##################################### | 100% 
ld_impl_linux-64-2.3 | 668 KB    | ##################################### | 100% 
cffi-1.14.6          | 226 KB    | ##################################### | 100% 
mistune-0.8.4        | 54 KB     | ##################################### | 100% 
sqlite-3.36.0        | 1.4 MB    | ##################################### | 100% 
importlib-metadata-4 | 31 KB     | ##################################### | 100% 
pillow-8.3.1         | 692 KB    | ##################################### | 100% 
libglib-2.68.3       | 3.1 MB    | ##################################### | 100% 
pthread-stubs-0.4    | 5 KB      | ##################################### | 100% 
harfbuzz-2.8.2       | 2.0 MB    | ##################################### | 100% 
jupyter_server-1.10. | 269 KB    | ##################################### | 100% 
idna-3.1             | 52 KB     | ##################################### | 100% 
zipp-3.5.0           | 12 KB     | ##################################### | 100% 
prometheus_client-0. | 46 KB     | ##################################### | 100% 
anyio-3.2.1          | 139 KB    | ##################################### | 100% 
requests-unixsocket- | 14 KB     | ##################################### | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
Installing pip dependencies: / Ran pip subprocess with arguments:
['/home/villares/miniconda3/envs/py5coding/bin/python', '-m', 'pip', 'install', '-U', '-r', '/tmp/condaenv.p7xiamvb.requirements.txt']
Pip subprocess output:
Collecting py5
  Downloading py5-0.5a0-py3-none-any.whl (11.5 MB)
Requirement already satisfied: ipykernel>=5.3 in ./lib/python3.8/site-packages (from py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (6.0.3)
Collecting nptyping>=1.4
  Using cached nptyping-1.4.2-py3-none-any.whl (31 kB)
Collecting ipywidgets>=7.6
  Downloading ipywidgets-7.6.3-py2.py3-none-any.whl (121 kB)
Collecting stackprinter>=0.2.4
  Using cached stackprinter-0.2.5-py3-none-any.whl (27 kB)
Requirement already satisfied: pillow>=8.1 in ./lib/python3.8/site-packages (from py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (8.3.1)
Requirement already satisfied: requests>=2.25 in ./lib/python3.8/site-packages (from py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (2.26.0)
Requirement already satisfied: line-profiler>=2.1.2 in ./lib/python3.8/site-packages (from py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (3.3.0)
Collecting numpy>=1.19
  Downloading numpy-1.21.1-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (15.8 MB)
Requirement already satisfied: ipython>=7.22 in ./lib/python3.8/site-packages (from py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (7.25.0)
Requirement already satisfied: traitlets>=5.0 in ./lib/python3.8/site-packages (from py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (5.0.5)
Requirement already satisfied: noise>=1.2 in ./lib/python3.8/site-packages (from py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (1.2.2)
Collecting pandas>=1.0
  Downloading pandas-1.3.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (10.6 MB)
Collecting jpype1>=1.2
  Downloading JPype1-1.3.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (449 kB)
Requirement already satisfied: matplotlib-inline<0.2.0,>=0.1.0 in ./lib/python3.8/site-packages (from ipykernel>=5.3->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (0.1.2)
Requirement already satisfied: debugpy<2.0,>=1.0.0 in ./lib/python3.8/site-packages (from ipykernel>=5.3->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (1.4.0)
Requirement already satisfied: jupyter-client<7.0 in ./lib/python3.8/site-packages (from ipykernel>=5.3->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (6.1.12)
Requirement already satisfied: tornado<7.0,>=4.2 in ./lib/python3.8/site-packages (from ipykernel>=5.3->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (6.1)
Requirement already satisfied: pygments in ./lib/python3.8/site-packages (from ipython>=7.22->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (2.9.0)
Requirement already satisfied: backcall in ./lib/python3.8/site-packages (from ipython>=7.22->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (0.2.0)
Requirement already satisfied: prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0 in ./lib/python3.8/site-packages (from ipython>=7.22->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (3.0.19)
Requirement already satisfied: jedi>=0.16 in ./lib/python3.8/site-packages (from ipython>=7.22->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (0.17.2)
Requirement already satisfied: setuptools>=18.5 in ./lib/python3.8/site-packages (from ipython>=7.22->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (49.6.0.post20210108)
Requirement already satisfied: pickleshare in ./lib/python3.8/site-packages (from ipython>=7.22->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (0.7.5)
Requirement already satisfied: pexpect>4.3 in ./lib/python3.8/site-packages (from ipython>=7.22->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (4.8.0)
Requirement already satisfied: decorator in ./lib/python3.8/site-packages (from ipython>=7.22->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (5.0.9)
Collecting jupyterlab-widgets>=1.0.0
  Downloading jupyterlab_widgets-1.0.0-py3-none-any.whl (243 kB)
Requirement already satisfied: nbformat>=4.2.0 in ./lib/python3.8/site-packages (from ipywidgets>=7.6->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (5.1.3)
Collecting widgetsnbextension~=3.5.0
  Downloading widgetsnbextension-3.5.1-py2.py3-none-any.whl (2.2 MB)
Requirement already satisfied: parso<0.8.0,>=0.7.0 in ./lib/python3.8/site-packages (from jedi>=0.16->ipython>=7.22->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (0.7.1)
Requirement already satisfied: pyzmq>=13 in ./lib/python3.8/site-packages (from jupyter-client<7.0->ipykernel>=5.3->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (22.1.0)
Requirement already satisfied: python-dateutil>=2.1 in ./lib/python3.8/site-packages (from jupyter-client<7.0->ipykernel>=5.3->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (2.8.2)
Requirement already satisfied: jupyter-core>=4.6.0 in ./lib/python3.8/site-packages (from jupyter-client<7.0->ipykernel>=5.3->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (4.7.1)
Requirement already satisfied: jsonschema!=2.5.0,>=2.4 in ./lib/python3.8/site-packages (from nbformat>=4.2.0->ipywidgets>=7.6->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (3.2.0)
Requirement already satisfied: ipython-genutils in ./lib/python3.8/site-packages (from nbformat>=4.2.0->ipywidgets>=7.6->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (0.2.0)
Requirement already satisfied: pyrsistent>=0.14.0 in ./lib/python3.8/site-packages (from jsonschema!=2.5.0,>=2.4->nbformat>=4.2.0->ipywidgets>=7.6->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (0.17.3)
Requirement already satisfied: six>=1.11.0 in ./lib/python3.8/site-packages (from jsonschema!=2.5.0,>=2.4->nbformat>=4.2.0->ipywidgets>=7.6->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (1.16.0)
Requirement already satisfied: attrs>=17.4.0 in ./lib/python3.8/site-packages (from jsonschema!=2.5.0,>=2.4->nbformat>=4.2.0->ipywidgets>=7.6->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (21.2.0)
Collecting typish>=1.7.0
  Using cached typish-1.9.2-py3-none-any.whl (45 kB)
Requirement already satisfied: pytz>=2017.3 in ./lib/python3.8/site-packages (from pandas>=1.0->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (2021.1)
Requirement already satisfied: ptyprocess>=0.5 in ./lib/python3.8/site-packages (from pexpect>4.3->ipython>=7.22->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (0.7.0)
Requirement already satisfied: wcwidth in ./lib/python3.8/site-packages (from prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0->ipython>=7.22->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (0.2.5)
Requirement already satisfied: charset-normalizer~=2.0.0 in ./lib/python3.8/site-packages (from requests>=2.25->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (2.0.0)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in ./lib/python3.8/site-packages (from requests>=2.25->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (1.26.6)
Requirement already satisfied: certifi>=2017.4.17 in ./lib/python3.8/site-packages (from requests>=2.25->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (2021.5.30)
Requirement already satisfied: idna<4,>=2.5 in ./lib/python3.8/site-packages (from requests>=2.25->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (3.1)
Requirement already satisfied: notebook>=4.4.1 in ./lib/python3.8/site-packages (from widgetsnbextension~=3.5.0->ipywidgets>=7.6->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (6.4.0)
Requirement already satisfied: terminado>=0.8.3 in ./lib/python3.8/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.6->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (0.10.1)
Requirement already satisfied: nbconvert in ./lib/python3.8/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.6->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (6.1.0)
Requirement already satisfied: argon2-cffi in ./lib/python3.8/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.6->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (20.1.0)
Requirement already satisfied: Send2Trash>=1.5.0 in ./lib/python3.8/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.6->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (1.7.1)
Requirement already satisfied: jinja2 in ./lib/python3.8/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.6->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (3.0.1)
Requirement already satisfied: prometheus-client in ./lib/python3.8/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.6->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (0.11.0)
Requirement already satisfied: cffi>=1.0.0 in ./lib/python3.8/site-packages (from argon2-cffi->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.6->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (1.14.6)
Requirement already satisfied: pycparser in ./lib/python3.8/site-packages (from cffi>=1.0.0->argon2-cffi->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.6->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (2.20)
Requirement already satisfied: MarkupSafe>=2.0 in ./lib/python3.8/site-packages (from jinja2->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.6->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (2.0.1)
Requirement already satisfied: bleach in ./lib/python3.8/site-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.6->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (3.3.1)
Requirement already satisfied: nbclient<0.6.0,>=0.5.0 in ./lib/python3.8/site-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.6->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (0.5.3)
Requirement already satisfied: jupyterlab-pygments in ./lib/python3.8/site-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.6->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (0.1.2)
Requirement already satisfied: pandocfilters>=1.4.1 in ./lib/python3.8/site-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.6->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (1.4.2)
Requirement already satisfied: entrypoints>=0.2.2 in ./lib/python3.8/site-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.6->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (0.3)
Requirement already satisfied: testpath in ./lib/python3.8/site-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.6->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (0.5.0)
Requirement already satisfied: defusedxml in ./lib/python3.8/site-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.6->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (0.7.1)
Requirement already satisfied: mistune<2,>=0.8.1 in ./lib/python3.8/site-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.6->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (0.8.4)
Requirement already satisfied: async-generator in ./lib/python3.8/site-packages (from nbclient<0.6.0,>=0.5.0->nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.6->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (1.10)
Requirement already satisfied: nest-asyncio in ./lib/python3.8/site-packages (from nbclient<0.6.0,>=0.5.0->nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.6->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (1.5.1)
Requirement already satisfied: webencodings in ./lib/python3.8/site-packages (from bleach->nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.6->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (0.5.1)
Requirement already satisfied: packaging in ./lib/python3.8/site-packages (from bleach->nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.6->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (21.0)
Requirement already satisfied: pyparsing>=2.0.2 in ./lib/python3.8/site-packages (from packaging->bleach->nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.6->py5->-r /tmp/condaenv.p7xiamvb.requirements.txt (line 1)) (2.4.7)
Installing collected packages: widgetsnbextension, typish, numpy, jupyterlab-widgets, stackprinter, pandas, nptyping, jpype1, ipywidgets, py5
Successfully installed ipywidgets-7.6.3 jpype1-1.3.0 jupyterlab-widgets-1.0.0 nptyping-1.4.2 numpy-1.21.1 pandas-1.3.0 py5-0.5a0 stackprinter-0.2.5 typish-1.9.2 widgetsnbextension-3.5.1

done
#
# To activate this environment, use
#
#     $ conda activate py5coding
#
# To deactivate an active environment, use
#
#     $ conda deactivate
hx2A commented 3 years ago

Hmmm. In the environment file http://py5.ixora.io/install/py5_environment.yml it instructs anaconda to install openjdk:

openjdk=11.0.8

But I don't see that listed in the list of things that are downloaded and extracted. Is it there and I missed it?

From the error message it looks like jpype is saying the jar file is compiled in a newer version of Java than what your JRE can handle. Installing that version of openjdk is supposed to take care of this.

Can you go to here:

http://py5.ixora.io/install/#detailed-steps

and look at the Install Java section? What version of Java do you have now? You will need Java 11.

Also, what kind of OS are you using? I thought you were a Windows user, but the file paths suggest Linux or OSX. Are you using the Window Linux subsystem?

villares commented 3 years ago

I'm using Manjaro XFCE, I used to use Xubuntu and Mac OS but Macs became too expensive in Brazil. I sometimes have to use Windows for teaching too.

image

villares commented 3 years ago

hmmm could it be that it was not istalled by conda? I might have installed it to test Processing 4 at some point.

image

hx2A commented 3 years ago

Can I see the output of these commands, both inside and outside of the Anaconda environment:

$ which java
$ echo $JAVA_HOME

Also, from Python:

import jpype
jpype.getDefaultJVMPath()

For the last one I get '/Users/jim/INSTALL/anaconda3/envs/py5/lib/jli/libjli.dylib'.

The JAVA_HOME environment variable needs to be set correctly for jpype to work.

Use the below command to install java in the Anaconda environment if it has not done so already:

$ conda install -c conda-forge openjdk=11.0.8
hx2A commented 3 years ago

Also, the exception you are getting:

java.lang.java.lang.UnsupportedClassVersionError: java.lang.UnsupportedClassVersionError: py5/core/Py5Methods has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

The 52 and 55 refer to Java 8 and 11, respectively.

https://en.wikipedia.org/wiki/Java_class_file#General_layout

Somehow you are using Java 8 instead of Java 11. I suspect it is a problem with JAVA_HOME.

villares commented 3 years ago

image

image

OH I THINK I FOUND SOMETHING!!!

image

image

So for some reason, when using Thonny it does not find the correct Java environment!

hx2A commented 3 years ago

That's interesting. I wonder why Thonny does that. @tabreturn, you have experience with Thonny, can you provide some advice here?

Also, @tabreturn's blog post on py5 and thonny:

https://tabreturn.github.io/code/python/thonny/2021/06/21/thonny_and_py5.html

villares commented 3 years ago

I suppose I'll have to go through the amazing self contained Thonny setup routine ¯_(ツ)_/¯

hx2A commented 3 years ago

It would be great if py5, Java 11, and Thonny could be packaged together, kind of like how the Processing is packaged up with the PDE and a JRE.

BTW, Processing is moving to Java 16 or 17 or something in the Fall (I believe) so py5 will have to move also.

I have an idea to make some improvements to py5 so it provides more straightforward feedback when the version of Java is inadequate.

villares commented 3 years ago

No, it think it's moving from 8 to 11 image

Yeah, a py5 bundle with Thonny would be awesome. Maybe we can build around their plug-ins feature...

VS Codium works fine for me now:-S image

hx2A commented 3 years ago

No, it think it's moving from 8 to 11

Right, but that move already happened in Processing 4. They are making a second move in the Fall to 17:

https://github.com/processing/processing4/wiki/Processing-4

Yeah, a py5 bundle with Thonny would be awesome. Maybe we can build around their plug-ins feature...

Yes, exactly. It may be a great fit.

VS Codium works fine for me now:-S

Excellent!

villares commented 3 years ago

Jim, thanks again for everything. It's been hard ride lately. I feel like I just can't concentrate anymore.

Yesterday on a whim I decided to try and create a Python reading club. People like you motivate me to try to give back my best to the community.

clube_de_leitura_python

tabreturn commented 3 years ago

I suppose I'll have to go through the amazing self contained Thonny setup routine ¯(ツ)

Maybe you just need this part -- the line I added to the Thonny executable (thonny/bin/thonny):
export JAVA_HOME=/path/to/jdk'

hx2A commented 3 years ago

Jim, thanks again for everything. It's been hard ride lately. I feel like I just can't concentrate anymore.

Yesterday on a whim I decided to try and create a Python reading club. People like you motivate me to try to give back my best to the community.

What a kind thing to say! Thank you so much for that. It means a lot. I didn't know what I was doing would motivate others to also contribute to the community. It happens I started py5 as an outlet for managing my pandemic related anxieties. If I am somehow also helping others with their pandemic anxieties, that's even better. :)

hx2A commented 3 years ago

This thread gave me the idea of improving how py5 responds when the JVM won't start or the JVM version is insufficient. Below is an example from a test environment I created with Java 7. This is easier to follow than the nested Java exceptions you received. This exception will either guide the user to a proper fix or will assist anyone who is helping them:

In [1]: import py5
py5 is unable to start a Java 11 Virtual Machine.
This library requires Java 11 to be installed and a properly set JAVA_HOME environment variable.
Here is some debug info about your installation that might help you identify the source of this problem.
{'JAVA_HOME environment variable': '/home/jim/INSTALL/anaconda3/envs/java7test', 'jvm version': (0, 0, 0), 'default jvm path': '/home/jim/INSTALL/anaconda3/envs/java7test/x86_64-conda-linux-gnu/sysroot/usr/lib64/jvm/java-1.7.0-openjdk-1.7.0.181.x86_64/jre/lib/amd64/server/libjvm.so'}
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-1-6c88b15a5077> in <module>
----> 1 import py5

~/Projects/ITP/pythonprocessing/py5code/py5/__init__.py in <module>
     55         print("Here is some debug info about your installation that might help you identify the source of this problem.", file=sys.stderr)
     56         print(debug_info, file=sys.stderr)
---> 57         raise RuntimeError("py5 is unable to start Java 11 Virtual Machine")
     58
     59 from .methods import register_exception_msg  # noqa

RuntimeError: py5 is unable to start Java 11 Virtual Machine
villares commented 3 years ago

SUCCESS! Under Tonny options, set environment variable to JAVA_HOME=/home/villares/miniconda3/envs/py5coding/ (and don't forget the trailing slash!) image

tabreturn commented 3 years ago

Thanks for sharing, @villares! I totally overlooked this feature in Thonny.

hx2A commented 3 years ago

I just updated the install docs with the lessons learned from this thread:

http://py5.ixora.io/install/#thonny