Minimal python install for thonny ide

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
DanielRossinsky
Posts: 9
Joined: Fri Jun 12, 2020 4:04 am

Minimal python install for thonny ide

Post by DanielRossinsky » Fri Jun 12, 2020 4:09 am

I'm currently working on an automated install for thonny ide and python. The thing is I can't use the thonny installer because I need python installed first in order to install esptool and thonny through pip. The problem however is that I can't find any unattended.xml file in the thonny installer or anything online about the python its bundled with e.g. is it full python or embedded ? And what flags does the thonny installer use with the silent python install?

I would appriciate any hint/source/help!

INFO: The thonny version im trying to install is 3.2.7 and the python version is 3.8.3 and the targeted board I will be using is an esp32 with micropython.

stijn
Posts: 735
Joined: Thu Apr 24, 2014 9:13 am

Re: Minimal python install for thonny ide

Post by stijn » Fri Jun 12, 2020 6:29 am

I don't fully undesrtand the question - the Thonny pip package is just a bunch of Python files. Can't you first install Python (personally I always use Miniconda3, create an environment in it using Python 3.8.3, all silent), then 'pip install Thonny'?

In any case: posting an issue on Thonny's github might get more response. And the source for building installers is there as well .

DanielRossinsky
Posts: 9
Joined: Fri Jun 12, 2020 4:04 am

Re: Minimal python install for thonny ide

Post by DanielRossinsky » Fri Jun 12, 2020 6:45 am

The problem is not silently installing. And I did check for the thonny installer which only tells how to quietly install thonny.
The problem however is that I cant find any unattend.xml file nor any command with installer switches in the thonny github that would tell me what minimal features I need installed to use the ide with micropython.
About posting an issue on the thonny github. i don't consider that as an issue its more like asking them for the installer switches they used with their bundeled python and I don't think it follows the guidelines of github to ask such a question as there is no thonny forum.

stijn
Posts: 735
Joined: Thu Apr 24, 2014 9:13 am

Re: Minimal python install for thonny ide

Post by stijn » Fri Jun 12, 2020 8:21 am

Sorry, I have only briefly used Thonny, so I just don't understand what you are trying to do. Can you maybe clarify: you mention 3 different types of Python: MicroPython, Python 3.8.3 and 'bundeled Python'. MicroPython has no installer so that should not be an issue? As for 'bundeled': what does that mean? That if you install Thonny via pip it will try to install another version of Python than the one running pip? Are you asking how to circumvent that? And/or are you asking how to silently instruct Thonny to use MicroPython?

User avatar
aivarannamaa
Posts: 171
Joined: Fri Sep 22, 2017 3:19 pm
Location: Estonia
Contact:

Re: Minimal python install for thonny ide

Post by aivarannamaa » Fri Jun 12, 2020 10:57 am

Daniel, I agree with Stijn that Thonny's issue tracker would be good place for this question.

The short answer is that Thonny needs Python with Tkinter. Windows and macOS builds are based on official installers (https://www.python.org/ftp/python/3.7.7 ... -3.7.7.exe and https://www.python.org/ftp/python/3.7.7 ... sx10.9.pkg). If you need more details then I suggest you create an issue in Thonny's issue tracker.
Aivar Annamaa
https://thonny.org

DanielRossinsky
Posts: 9
Joined: Fri Jun 12, 2020 4:04 am

Re: Minimal python install for thonny ide

Post by DanielRossinsky » Fri Jun 12, 2020 11:47 am

@stijn il explain myself better (I'm not a native English speaker so sorry for not being able to explain properly)
1) I know micropython has no installer i only flash it to my esp32 as firmware.
2) bundeled python is just regular python3.7 that is installed by thonny.exe as default if you don't have python installed.
3)I want to use python 3.8.3 with thonny and not the bundeled version (python 3.7 is supplied with thonny by default if you don't have any python installed).
My issue is that thonny uses custom installer switches for its bundeled python without including any unattend.xml file nor any information on their github about what installer switches they use and I'm trying to figure out what they are so I can set the same installer switches but with python 3.8.3 instead.
Python installer switches: https://docs.python.org/3/using/windows.html section 3.1.3 installing without ui.

DanielRossinsky
Posts: 9
Joined: Fri Jun 12, 2020 4:04 am

Re: Minimal python install for thonny ide

Post by DanielRossinsky » Fri Jun 12, 2020 11:51 am

@aviarannamaa as I answered to stijn I don't think its an issue with thonny. They just don't seem to supply the installer switches they use. I know what version of python thonny uses but not the installer switches it uses.

stijn
Posts: 735
Joined: Thu Apr 24, 2014 9:13 am

Re: Minimal python install for thonny ide

Post by stijn » Fri Jun 12, 2020 1:39 pm

Ok makes sense now.

Looks like that's not going to work; if this is what I think it is: https://github.com/thonny/thonny/blob/m ... taller.bat then they don't use an installer and hence no switches, instead the build machine is required to have Python installed, when building the installer they just copy all Python files (and then delete the Python license, if I read it correctly, strange and possibly not even allowed) and their installer just copies all files to the target machine. I.e. to get what you want it kinda looks like you first have to install Thonny, then replace the entire Python they copied with another one?

DanielRossinsky
Posts: 9
Joined: Fri Jun 12, 2020 4:04 am

Re: Minimal python install for thonny ide

Post by DanielRossinsky » Fri Jun 12, 2020 2:19 pm

The other way around. I want to install python 3.8.3 first and than thonny 3.2.7. The thing is, even if they copied the python files it means they had a custom install at one point or another and just copied the files of the install and what I'm trying to find are exactly the custom options they chose before copying the python files into the installer.
Once I find these options I can simply install python 3.8.3 first with these options and than use: "pip install thonnyapp" to install thonny on top of python 3.8.3 I just installed earlier without deleting or interacting with the bundled python which was just copied into the thonny installer.

What I said above is possible according to this page: https://github.com/thonny/thonny/wiki/Windows

Closest I got to the custom python settings is: https://github.com/thonny/thonny/blob/m ... python.ini pretty disappointing for open source

stijn
Posts: 735
Joined: Thu Apr 24, 2014 9:13 am

Re: Minimal python install for thonny ide

Post by stijn » Fri Jun 12, 2020 2:55 pm

DanielRossinsky wrote:
Fri Jun 12, 2020 2:19 pm
trying to find are exactly the custom options they chose before
That's really something for Thonny's github issue tracker then, if that's the only way to get in touch with them, and pretty much out of scope for a MicroPython forum.

Post Reply