I developed a Tkinter app (with python version 3.10.6) on a mac (BigSur) and wrapped all the app files through py2app for use on others macs. When I run on another mac (Monterey) I get the following error:
_tkinter.TclError: Can't find a usable init.tcl in the following directories:
/usr/local/Cellar/tcl-tk/8.2 12_1/lib/tcl8.6
I search all over the internet and couldn't find any solution. What should I do to correct this blocking problem ?
update question 01/10/2022
In fact, here is the problem that I was unable to explain the first time: I coded my python application on a 2020 Mac (Silicon processor). At work I have an old Mac from 2013 (Intel processor). When I coded my app on the work Mac, I wrapped all my python files with py2app to make it an .app (the goal being to use the application on other macs). For that I had to update my version of python and install the homebrew package manager.
- Homebrew is installed in /opt/homebrew for Macs equipped with a Silicon processor
- Homebrew is installed in /usr/local for Macs with an Intel processor So when I run my version (coded on the 2013 Mac) on my 2020 Mac, I get an error message because it is looking for tcl-tk/8.2 12_1/lib/tcl8.6 in the /usr/ folder local/ and it can't find it since it's in /opt/homebrew. Conversely, if I code on my 2020 mac, wrap with py2app and run the app on my 2013 work computer, I get an error message because it's looking for tcl-tk/8.2 12_1/lib /tcl8.6 in the /opt/homebrew folder.
I don't know how to solve this problem; in any case I tried hard to understand; I am a beginner and if you have an idea of code to add to make this distinction and get the right folder in the right place it would be very useful to me.