tabreturn / thonny-py5mode

A py5 plug-in for Thonny
Do What The F*ck You Want To Public License
23 stars 8 forks source link

Running a sketch on Windows returns "Process ended with exit code 3221226356." #64

Open kemesarosh opened 1 week ago

kemesarosh commented 1 week ago

I've tried running a py5 sketch on several Windows machines and all return a "Process ended with exit code 3221226356" error, which I believe is a heap corruption error. No problems on Mac.

thonny version: 4.1.4 py5 plug-in version: 0.10.2a0

py5_error

When I select the About thonny-py5mode dropdown option from py5 taskbar, a window opens with the following:

Internal Error
Traceback (most recent call last):
  File "C:\Users\kemesarosh\AppData\Local\Programs\Thonny\lib\tkinter\__init__.py", line 1921, in __call__
    return self.func(*args)
  File "C:\Users\kemesarosh\AppData\Local\Programs\Thonny\lib\site-packages\thonny\workbench.py", line 1109, in dispatch_from_menu
    dispatch(None)
  File "C:\Users\kemesarosh\AppData\Local\Programs\Thonny\lib\site-packages\thonny\workbench.py", line 1035, in dispatch
    handler()
  File "C:\Users\kemesarosh\AppData\Roaming\Thonny\plugins\Python310\site-packages\thonnycontrib\thonny-py5mode\about_plugin.py", line 120, in open_about_plugin
    ui_utils.show_dialog(AboutDialog(get_workbench()))
  File "C:\Users\kemesarosh\AppData\Roaming\Thonny\plugins\Python310\site-packages\thonnycontrib\thonny-py5mode\about_plugin.py", line 81, in __init__
    + '\n Python ' + get_python_version_string(maxsize=sys.maxsize)
TypeError: get_python_version_string() got an unexpected keyword argument 'maxsize'
villares commented 1 week ago

Hi @kemesarosh! Thank you for your report!

I think I had seen the "about" problem before, it should be fixed in the next plug-in release... https://github.com/tabreturn/thonny-py5mode/pull/60

But the "Process ended with exit code 3221226356." seems new and I hope you can help us figure it out to fix it!

kemesarosh commented 1 week ago

Hi Alexandre. Thank you for the quick response!

It is not the portable Thonny (but I will try it). It is the thonny-4.0.2.exe https://github.com/thonny/thonny/releases/download/v4.0.2/thonny-4.0.2.exe version from your site: https://abav.lugaralgum.com/como-instalar-py5/index-EN.html I've tried it only on Windows 11. I tried the module mode and it gave the same error message.

FYI: I installed the same thonny as above and installed the plug-in as shown on your site this past spring on Windows 11 for your excellent course on Domestika. It still works fine. I then tried installing it on Windows laptops in late July and started receiving the error. I noticed that the plug-in has been updated since then, so could be where the problem is.

On Fri, Oct 4, 2024 at 3:03 PM Alexandre B A Villares < @.***> wrote:

Hi @kemesarosh https://github.com/kemesarosh! Thank you for your report!

I think I had seen the "about" problem before, it should be fixes in the next plug-in release... #60 https://github.com/tabreturn/thonny-py5mode/pull/60

But the "Process ended with exit code 3221226356." seems new and I hope you can help us figure it out to fix it!

  • Is this the portable Thonny with py5 pre-installed (from here https://github.com/villares/thonny-portable-with-py5/) ?
  • Can you please elaborate on which version of Windows you are using?
  • Do "module mode" py5 sketches work (with the plug-in disabled, using import py5 etc.) ?

— Reply to this email directly, view it on GitHub https://github.com/tabreturn/thonny-py5mode/issues/64#issuecomment-2394389171, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABA55F2OBYGHOTSS7ZEJBHDZZ3Q6NAVCNFSM6AAAAABPMD5XXGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJUGM4DSMJXGE . You are receiving this because you were mentioned.Message ID: @.***>

villares commented 1 week ago

Oh, thank you!

I really hope we can fix this soon, but I don't have access to a Windows 11 machine right now to test.

I could quickly update my page if you can confirm that that Thonny 4.1.6 works (from https://github.com/thonny/thonny/releases/tag/v4.1.6 or even https://thonny.org/)

And please let me know if the portable works too... Next week I might be able to work on a new portable if necessary.

kemesarosh commented 1 week ago

Both give the same error. I tried the 4.1.6 .exe and the portable (which doesn't include the py5 module--I didn't see one that included it). I also tried it with the py5 module disabled. Same error.

On Fri, Oct 4, 2024 at 5:01 PM Alexandre B A Villares < @.***> wrote:

Oh, thank you!

I really hope we can fix this soon, but I don't have access to a Windows 11 machine right now to test.

I could quickly update my page if you can confirm that that Thonny 4.1.6 works (from https://github.com/thonny/thonny/releases/tag/v4.1.6 or even https://thonny.org/)

And please let me know if the portable works too... Next week I might be able to work on a new portable if necessary.

— Reply to this email directly, view it on GitHub https://github.com/tabreturn/thonny-py5mode/issues/64#issuecomment-2394588473, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABA55F5OTBUNFBTN6XXJOTLZZ363RAVCNFSM6AAAAABPMD5XXGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJUGU4DQNBXGM . You are receiving this because you were mentioned.Message ID: @.***>

villares commented 1 week ago

Hmmm, strange... And, oh, this is the portable that has py5 and the py5 plug-in preinstalled (not in Thonny's site): https://github.com/villares/thonny-portable-with-py5/releases/download/2024-07-13/thonny-414-with-py5-windows-portable.zip

Beware that the portable might be looking for libraries installed by previous Thonny at the user folder instead of its own site-packages, you might want to remove (or temporarily rename) \Users\<username>\AppData\Roaming\Python\Python3<?>\site-packages.

kemesarosh commented 1 week ago

Oh, I already tried the portable 4.14 with py5 early. It gave the same error. There was no python folder in AppData\Roaming, but there was a Thonny folder, so I deleted it and downloaded portable with py5 again and ran it to make sure, and it still gives the same error.

On Fri, Oct 4, 2024 at 6:07 PM Alexandre B A Villares < @.***> wrote:

Hmmm, strange... And, oh, this is the portable that has py5 and the py5 plug-in preinstalled (not in Thonny's site): https://github.com/villares/thonny-portable-with-py5/releases/download/2024-07-13/thonny-414-with-py5-windows-portable.zip

Beware that the portable might be looking for libraries installed by previous Thonny at the user folder instead of its own site-packages, you might want to remove \Users\\AppData\Roaming\Python\Python3<?>\site-packages.

— Reply to this email directly, view it on GitHub https://github.com/tabreturn/thonny-py5mode/issues/64#issuecomment-2394730857, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABA55F3NBI2ZXKC7MDGGAPLZZ4GSNAVCNFSM6AAAAABPMD5XXGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJUG4ZTAOBVG4 . You are receiving this because you were mentioned.Message ID: @.***>

villares commented 6 days ago

Oh dear, I'm sorry to hear that. Thanks for the patience and effort testing. I'll see if I can find some Windows 11 to test in the next weeks.

villares commented 6 days ago

Something that came to my mind, a long shot but might bring new information... could you try different renderers like size(400, 400, P2D) or size(400, 400, P3D) ?

Ref: https://py5coding.org/reference/sketch_size.html

villares commented 6 days ago

Yet another idea... can you follow the "anaconda/miniconda env" install method as described in https://py5coding.org/content/install.html#anaconda-or-miniconda-setup ? Then we could check if py5 works on another (conda managed) Python env in your computer and it is often possible to point Thonny to use that Pyhon interpreter instead of its own.

kemesarosh commented 6 days ago

I still get the same error on both of these.

On Sun, Oct 6, 2024 at 10:56 AM Alexandre B A Villares < @.***> wrote:

Something that came to my mind, a long shot but might bring new information... could you try different renderers like size(400, 400, P2D) or `size(400, 400, P3D) Ref: https://py5coding.org/reference/sketch_size.html

— Reply to this email directly, view it on GitHub https://github.com/tabreturn/thonny-py5mode/issues/64#issuecomment-2395469132, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABA55F7YFQPR5LHGW4QR2PLZ2FFSNAVCNFSM6AAAAABPMD5XXGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJVGQ3DSMJTGI . You are receiving this because you were mentioned.Message ID: @.***>

kemesarosh commented 6 days ago

I've got py5 working in VSCode using python 3.12 andthe pip installed py5 library.

What I'm wanting is to get it working in Thonny for my introduction to programming class--in one download. As I said, it works fine on Mac, but since the June(?) update, py5 mode on Windows returns the error.

I'm actually working with the lab director at school tomorrow to get the conda version working, as we already have Anaconda installed, and have VSCode pointing to its python distribution. I tried the conda install you linked to last week on the lab computers and it couldn't find Java, as JAVA_HOME is not set globally on the lab computers, but the lab director can fix that.

*Most students use their own laptops, so I can get them working for the remainder of this semester with VSCode--and if needed, a python install and java install, if the conda py5 doesn't work. But there are a few in every section that use the lab desktop computers. Plus, I have an online class, so a single download of Thonny with py5 mode and its java install will make things so much easier for beginners.

Thanks for your help!

On Sun, Oct 6, 2024 at 2:38 PM Alexandre B A Villares < @.***> wrote:

Yet another idea... can you follow the "anaconda/miniconda env" install method as described in https://py5coding.org/content/install.html#anaconda-or-miniconda-setup ? Then we could check if py5 works on another (conda managed) Python env in your computer and it is often possible to point Thonny to use that Pyhon interpreter instead of its own.

— Reply to this email directly, view it on GitHub https://github.com/tabreturn/thonny-py5mode/issues/64#issuecomment-2395538954, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABA55F5TRDYYF4HF3TPKRPLZ2F7TJAVCNFSM6AAAAABPMD5XXGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJVGUZTQOJVGQ . You are receiving this because you were mentioned.Message ID: @.***>

villares commented 6 days ago

I really want to understand and have this fixed :(

I don't know if this would be useful but, FYI:

Note: lots of typos in this as I quickly replied, sorry... your email copy must have been completely cryptic.

kemesarosh commented 6 days ago

I pointed thonny's interpreter to my local python 3.12 with py5 installed and I still get the same error message.

The online editor is nice, and may work for those without laptops for a few weeks. Thanks! I didn't know there was a pyp5js.

Is there a way to install the previous py5 plug-in for Thonny? As I said earlier, I still have the 0.8.0a2 version installed on my desktop PC and it works fine on Windows 11.

On Sun, Oct 6, 2024 at 3:53 PM Alexandre B A Villares < @.***> wrote:

I really what to understand and have this fixed :(

I don't know if this would be useful but, FYI:

  • On Thonny's Tools > Options... > Interpreters (tab) you can try pointing it tho the Python executable of your conda env. And then you could use Thonny's Options.. > General (tab) to set the JAVA_HOME.
  • As an emergency solution in class I sometimes use this pyodide based editor in the browser (not the same as py5 but usable for basic stuff) https://abav.lugaralgum.com/pyp5js/py5mode

— Reply to this email directly, view it on GitHub https://github.com/tabreturn/thonny-py5mode/issues/64#issuecomment-2395563100, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABA55F3NMUHKLACX6ZFLYCLZ2GIMTAVCNFSM6AAAAABPMD5XXGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJVGU3DGMJQGA . You are receiving this because you were mentioned.Message ID: @.***>

villares commented 5 days ago

Is there a way to install the previous py5 plug-in for Thonny?

Maybe from releases but I'm not sure if 0.8.0a2 is there.

You could try copying your files in a thumb-drive and overwriting the folder inside site-packages with your version too, maybe? Maybe copying the whole Thonny folder in a thumb-drive?

I have these older versions on my dropbox: 2024 https://www.dropbox.com/scl/fi/2mnhk1k1yj6ab55p02z6q/thonny-4-with-py5-100-windows-portable.zip?rlkey=0du7vkd2nn2etlwftqw69hq1t&st=7okw431o&dl=0 2023 https://www.dropbox.com/scl/fi/ytyzpuyjmtmc5is6dwq3b/thonny-4-with-py5-091-windows-portable.zip?rlkey=ff5kxmyng4ebr1faglaej9zou&st=c8c34so9&dl=0 2022 https://www.dropbox.com/scl/fi/lmc0cy3ipxhenqei8fvqf/thonny-4-with-py5-windows-portable.zip?rlkey=8xln225daitaj1fdgixk92cr1&st=lwb061xl&dl=0

hx2A commented 5 days ago

Hi, @kemesarosh ! I will do what I can to help you.

As I said, it works fine on Mac, but since the June(?) update, py5 mode on Windows returns the error.

Are you seeing this on all Windows machines, or just a few of them?

What if you run a generic python interpeter and run import py5. Does it crash then? What about if try that in Thonny, without the plugin?

If either of those fail, can you try:

import jpype

jpype.startJVM()

There might be something off about with the Java install on these machines. Can you tell me which Java JRE is installed? Both the version and who maintains it (ie openjdk, oracle, etc).

What I'm wanting is to get it working in Thonny for my introduction to programming class

Out of curiosity, can you tell me more about your class? I do like to learn more about how py5 is being used.

kemesarosh commented 4 days ago

Hi, Jim. Sorry for the late reply. I tried the Thonny py5mode on an older HP desktop and on a new Dell laptop, as well as had a colleague try it on her Windows machine (not sure what she has). All gave the same error.

I can get the py5 library running on VSCode with pip install and import py5. I'm tried to get it running on the school lab computers using anaconda's python, but JAVA_HOME is not set up on them and py5 can't find it, but the lab director says he can write a script to get it working.

I can find a workaround for now, but I would just like to see if the Thonny py5 plug-in can be fixed for Windows so that in future classes i can use that in my introduction to programming classes as it is a simple one-download set up (I also teach online sections).

As I said, the class is an introduction to programming, using Python. We now have so many non-Computer Science majors taking the class that are totally new to programming that I think it will be helpful and more interesting to start out with visual and creative projects using Py5. I plan on having the students use basic shapes to create geometric art, and gradually introduce variables, conditions, loops, lists, etc. to create more complex patterns and move into animations.

Thanks for your response!

On Sun, Oct 6, 2024 at 10:51 PM Jim @.***> wrote:

Hi, @kemesarosh https://github.com/kemesarosh ! I will do what I can to help you.

As I said, it works fine on Mac, but since the June(?) update, py5 mode on Windows returns the error.

Are you seeing this on all Windows machines, or just a few of them?

What if you run a generic python interpeter and run import py5. Does it crash then? What about if try that in Thonny, without the plugin?

If either of those fail, can you try:

import jpype jpype.startJVM()

There might be something off about with the Java install on these machines. Can you tell me which Java JRE is installed? Both the version and who maintains it (ie openjdk, oracle, etc).

What I'm wanting is to get it working in Thonny for my introduction to programming class

Out of curiosity, can you tell me more about your class? I do like to learn more about how py5 is being used.

— Reply to this email directly, view it on GitHub https://github.com/tabreturn/thonny-py5mode/issues/64#issuecomment-2395785003, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABA55F7KLJ7USNLANQYOCFLZ2HZKBAVCNFSM6AAAAABPMD5XXGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJVG44DKMBQGM . You are receiving this because you were mentioned.Message ID: @.***>

hx2A commented 4 days ago

I tried the Thonny py5mode on an older HP desktop and on a new Dell laptop, as well as had a colleague try it on her Windows machine (not sure what she has). All gave the same error.

Hmmm, interesting that you get the same error on so many machines, and yet @villares and I have not experienced this ourselves on Windows. These are all Windows 11, right? These are all school computers?

I can get the py5 library running on VSCode with pip install and import py5. I'm tried to get it running on the school lab computers using anaconda's python, but JAVA_HOME is not set up on them and py5 can't find it, but the lab director says he can write a script to get it working.

The install instructions mention using the Python library install-jdk to install Java. It will install the JRE to a location that py5 knows about and will check for. You might be able to use this approach if for some reason the JAVA_HOME approach didn't work out. Also, this might be worth a try anyway because your bad exit codes could be caused by something funny with the JREs installed on these computers.

I can find a workaround for now, but I would just like to see if the Thonny py5 plug-in can be fixed for Windows so that in future classes i can use that in my introduction to programming classes as it is a simple one-download set up (I also teach online sections).

Yes, absolutely. @villares and I both want simple and easy setups for our users!

We now have so many non-Computer Science majors taking the class that are totally new to programming that I think it will be helpful and more interesting to start out with visual and creative projects using Py5. I plan on having the students use basic shapes to create geometric art, and gradually introduce variables, conditions, loops, lists, etc. to create more complex patterns and move into animations.

Neat. @villares has a similar approach for his classes.

kemesarosh commented 4 days ago

My current laptop is a new Dell with Windows 11, which replaced the older HP desktop I had in my office which may have been Windows 10. I tried Thonny py5 plug-in on both and got the same error. I haven't tried Thonny on the lab computers yet. Most students have their own laptops, but a few don't and use the lab computers. I just need a backup for those that use the lab computers, and also for any students who are impaired.

The school now has a new software approval policy that states all software we use has to meet ADA accessibility requirements, which Thonny does not. I believe we can still use Thonny if we have an accommodation plan for students who are visually impaired (screen-reading, etc.). I'm hoping that having VSCode or Pycharm with py5 library for the accommodation plan will allow us to use Thonny for the rest of the students.

I'm assuming from previous GitHub comments that adding accessibility features to Thonny is not planned.

On Tue, Oct 8, 2024 at 12:06 AM Jim @.***> wrote:

I tried the Thonny py5mode on an older HP desktop and on a new Dell laptop, as well as had a colleague try it on her Windows machine (not sure what she has). All gave the same error.

Hmmm, interesting that you get the same error on so many machines, and yet @villares https://github.com/villares and I have not experienced this ourselves on Windows. These are all Windows 11, right? These are all school computers?

I can get the py5 library running on VSCode with pip install and import py5. I'm tried to get it running on the school lab computers using anaconda's python, but JAVA_HOME is not set up on them and py5 can't find it, but the lab director says he can write a script to get it working.

The install instructions https://py5coding.org/content/install.html mention using the Python library install-jdk https://github.com/jyksnw/install-jdk to install Java. It will install the JRE to a location that py5 knows about and will check for. You might be able to use this approach if for some reason the JAVA_HOME approach didn't work out. Also, this might be worth a try anyway because your bad exit codes could be caused by something funny with the JREs installed on these computers.

I can find a workaround for now, but I would just like to see if the Thonny py5 plug-in can be fixed for Windows so that in future classes i can use that in my introduction to programming classes as it is a simple one-download set up (I also teach online sections).

Yes, absolutely. @villares https://github.com/villares and I both want simple and easy setups for our users!

We now have so many non-Computer Science majors taking the class that are totally new to programming that I think it will be helpful and more interesting to start out with visual and creative projects using Py5. I plan on having the students use basic shapes to create geometric art, and gradually introduce variables, conditions, loops, lists, etc. to create more complex patterns and move into animations.

Neat. @villares https://github.com/villares has a similar approach for his classes.

— Reply to this email directly, view it on GitHub https://github.com/tabreturn/thonny-py5mode/issues/64#issuecomment-2398781626, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABA55F6TK4INLBZUEGWZVI3Z2NK4NAVCNFSM6AAAAABPMD5XXGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJYG44DCNRSGY . You are receiving this because you were mentioned.Message ID: @.***>

kemesarosh commented 4 days ago

Okay, I just upgraded to the new version of the Thonny py5 mode on my home windows 11 desktop (I still had the previous version) and the new version works fine, so you are probably right about the Java install on the other machines--the ones I tested on were school supplied, and the lab director pre-installed Java. The Java distribution we're required to use is adoptium jdk 17. I don't have admin privileges to check or set JAVA_HOME, which may be the problem if that is what it looks for. I'll get with the lab director tomorrow if he's free and see what he can do.

Thanks!

On Sun, Oct 6, 2024 at 10:51 PM Jim @.***> wrote:

Hi, @kemesarosh https://github.com/kemesarosh ! I will do what I can to help you.

As I said, it works fine on Mac, but since the June(?) update, py5 mode on Windows returns the error.

Are you seeing this on all Windows machines, or just a few of them?

What if you run a generic python interpeter and run import py5. Does it crash then? What about if try that in Thonny, without the plugin?

If either of those fail, can you try:

import jpype jpype.startJVM()

There might be something off about with the Java install on these machines. Can you tell me which Java JRE is installed? Both the version and who maintains it (ie openjdk, oracle, etc).

What I'm wanting is to get it working in Thonny for my introduction to programming class

Out of curiosity, can you tell me more about your class? I do like to learn more about how py5 is being used.

— Reply to this email directly, view it on GitHub https://github.com/tabreturn/thonny-py5mode/issues/64#issuecomment-2395785003, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABA55F7KLJ7USNLANQYOCFLZ2HZKBAVCNFSM6AAAAABPMD5XXGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJVG44DKMBQGM . You are receiving this because you were mentioned.Message ID: @.***>

hx2A commented 4 days ago

The school now has a new software approval policy that states all software we use has to meet ADA accessibility requirements, which Thonny does not.

Wait, really? Thonny does not meet ADA accessibility requirements? I'm surprised. I remember being on a mailing list of blind or low vision Python folks and they liked Thonny because it was beginner friendly. Do I misremember this? Maybe there are other problems with Thonny?

In any case I do respect your school's policy here, it is a good thing to take this issue seriously.

I'm assuming from previous GitHub comments that adding accessibility features to Thonny is not planned.

I'm disappointed to hear this.

I know from doing accessibility work that programming something to be accessible works best if you build it that way from the start. Trying to add accessibility features later is much more work. Still, it is important, especially if you want your tool to be beginner friendly and to be used on schools.

I do use VSCode and note that they always talk about improvements to accessibility features in their monthly release notes. It is a big program though with a lot of features that perhaps would be intimidating to someone new to programming. Pycharm is accessible? Is it more beginner friendly?

What other Python editors are accessible that you know of? I just looked up Mu editor and I see their most recent open issue is about accessibility. It was opened on September 2nd, with no replies. Not a good sign.

hx2A commented 4 days ago

I just looked up Thonny + accessibility:

https://github.com/thonny/thonny/issues?q=accessibility

One of them says:

I am aware of the needs of blind users, but unfortunately, the UI toolkit used in Thonny (Tk) does not support screen readers.

I've considered bolting on some support on Thonny's side, but it still requires a C programmer knowledgeable in accessibility API-s for Windows, macOS and Linux.

I see what you are saying. Thonny isn't going to become accessible anytime soon.