Closed JotaCamargo closed 1 month ago
Hi, @JotaCamargo !
Hmmm, this is a problem we've seen before. The thonny plugin is supposed to take of this, but sometimes you need to intervene to get it to work.
Can you tell us more about your computer? What kind of computer is it? If this is an apple computer, is it one of the Apple Silicon machines?
@villares is the expert at solving these kinds of problems and I know he'll have good advice for what to do.
Hi, I have the same issue. I also get a message indicating that an environment variable JAVA_HOME hasn't been set. I have tried the recommended suggestions. I have been running Thonny on iMac and Windows platforms for several years and never had this issue with plug-ins. I look forward to your advice.
Hi, @john-humphries ! @villares and I have seen this problem before and will be happy to help you with this.
py5 is different from other Python libraries in that you are required to install a Java Virtual Machine. Your computer probably doesn't have that by default. Have you installed that already? How did you install it?
Can you copy paste the exact error message you are getting or perhaps provide a screenshot?
Thanks!
Appreciate your rapid response!
Was trying to run this example on Windows 10 (it now works correctly on my iMac - I don't know why):
import py5 as 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()
And get this:
Traceback (most recent call last): File "C:\Users\john\AppData\Local\Programs\Thonny\lib\site-packages\py5_tools\tools\run_sketch.py", line 58, in
Cheers John!
Confirm for me please that your Thonny has a py5 menu. With the py5 menu > imported mode for py5 option turned on/checked, your test code should be like this (no need for the py5 import and prefix):
def setup():
size(200, 200)
rect_mode(CENTER)
def draw():
rect(mouse_x, mouse_y, 10, 10)
Otherwise, using the imported mode off/unchecked you should be able to run this:
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()
Does these change the error messages?
Also you could try on the shell (the bottom part of Thonny's window with >>>
)
import py5
(and press ENTER)
Then we can investigate together further!
Hi, Tried your suggestions but still no luck. I'm away for a few weeks now and will take it up again on my reurn. Thanks again, John
Hi, Tried your suggestions but still no luck. I'm away for a few weeks now and will take it up again on my reurn. Thanks again, John
When you are back, tell me about the import py5
result, copy here the complete error from the shell, and we will try some other debugging explorations, thanks!
PS: Are you using the Thonny portable from my dropbox ?
Cheers @john-humphries! Have you had the chance to try again and the "portable" Thonny from my dropbox link?
Hi @JotaCamargo! Have you made it work for you?
We might want to close this issue for now, OK?
Hi Alexandre,
Yes, this enquiry can be closed. Thank you Kind regards
John
On Sat, 25 May 2024 at 19:35, Alexandre B A Villares < @.***> wrote:
Closed #436 https://github.com/py5coding/py5generator/issues/436 as completed.
— Reply to this email directly, view it on GitHub https://github.com/py5coding/py5generator/issues/436#event-12933682398, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARWEQI4JDWG5AGTEGWGV3FTZEDKXHAVCNFSM6AAAAABFEDHZGCVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJSHEZTGNRYGIZTSOA . You are receiving this because you were mentioned.Message ID: @.***>
Hi. I am looking to learn the fundamentals of creative coding in py5, and have previously installed Thonny and installed the thonny-py5mode plugin as well, acording to the instructions in a tutorial. Once I do everything that is supposed to be done and start writing code and playing it, it doesn't run, and in the console I get a text saying: "RuntimeError: py5 is unable to start Java 17 Virtual Machine". I am looking for how to solve this problem but I don't know how to do it. I don´t know why this has happened, if someone can help me to understand what can I do to solve it, I will be very grateful.