Error installing py5 in Windows 10 using Thonny

I’ve got this error installing py5 in the plug-in window in Thonny 4.0.1:
–prefix= --compile --install-headers ‘C:\Users\mauri\AppData\Roaming\Thonny\plugins\Python38\Include\jpype1’ Check the logs for full command output.
Error: process returned with code 1

What can I do?
Thanks in advance

1 Like

Hi @maurix,

Welcome to the forum! :wink:

Can you post the full logs?

1 Like

Cheers @maurix!

I think I have seen something similar when Windows fails to install JPype properly.

I have a few Ideas for you to try:

  1. This Thonny portable, in theory, has everything pre-installed Dropbox - thonny-4-with-py5-windows-portable.zip - Simplify your life

  2. Open Thonny’s Toos > Open System Shell… there you try to pip install jpyp1 and you will see more clearly the error (because it will not be in the small alert dialog). I suspect you’ll need to install some Microsoft CPP tooling to be able to compile JPype.

  3. Another way would be to (A) install a Miniconda Python distribution, (B) follow these steps: Install py5 — py5 documentation then (C) in Thonny Tools> Options > Interpreter, point it to use the Python from the Conda Environment.

Thanks a lot for your replies,

@josephh
which file di log in Thonny shoul I send? backend.log? …?

@villares
the portable version of Thonny does work, unfortunately it’s a bit slow, I’d like to use in the installed version

1 Like

I just installed Thonny and py5 and you should have this log window when you install the package:

(it worked fine for me on Linux with Python 3.11)

You can copy the logs from this window.

@josephh
@villares
I’m facing the problem n. 2 described by villares (see the final part of the log below).
I’ll try to install the required cpp software

many thanks

copying native\jars\org.jpype.jar -> build\lib.win32-3.8
Call build ext
building '_jpype' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
2 Likes

Cheers @maurix!

I think the next step would be to install https://visualstudio.microsoft.com/visual-cpp-build-tools/
But I’m afraid you won’t see any performance improvement. It will be the same library as in the portable…

I’m having some irritating delay for the sketches to start on Windows, and I’m using Thonny… I’m not sure what is the cause. I have no access to Windows for a while, but we could try running the sketch from the command line to see if it opens more quickly…

(Otherwise, when the sketch is already running, I see no performance difference on Thonny)

@villares
I managed to install py5 in Thonny, but I can’t import py5…
I attached the screenshot to show the problem
thanks

Oh @maurix, I’m so sorry you are going through these troubles! I really wish I could help more.

Let me try to help you investigate what is going on. Without much more evidence I would guess the shell window in the background is using a different interpreter, for some reason.

Is it the Thonny Console/Shell? When you hit the ‘stop’ button does it say Python 3.8?
Can you open the Tools > Options > Interpreter panel on Thonny to have a look?

1 Like

Hi @villares
here you are
thanks

1 Like

I see, looks like there is more than one Thonny and more than one Python indeed.
Try to set this Thonny to look for a Python interpreter at:
image
I’m not sure it will work, but could be worth a try…

There is just ipython.exe in the subdirectory scripts, but no python.exe at that location,…
thanks

1 Like

Hi @maurix, did you manage to make it work?

Since we last exchanged messages, I think that maybe the portable improved a bit at Dropbox - thonny-4-with-py5-windows-portable.zip - Simplify your life

Another strategy would be to install miniconda (or anaconda) and follow py5 install instructions, that suggests you to create a “conda env”, with that conda env active you could pip install thonny and have a Thonny that uses that Python env. Also, I think you should be able to use the thonny-py5mode plugin to install the JDK in this case too.

2 Likes

Thanks, Villares,
I’m not on the subject anymore (at the moment), but I’ve given a try to the portable version of Thonny and it seems to work for me. I appreciate your suggestions!

2 Likes