How to solve problem with Tkinter on MacOS: TclError? - macos

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.

Related

How do I build the Mono MDK on mac OS X?

I'm using Xamarin studio to write some C# code on OS X, but I upgraded my computer to OS X 10.11 (El Capitan) developer preview 3, which breaks mono
As per some of the instructions in those threads, I've compiled mono from source, and it appears to work (I can run mono on the command line, etc), however Xamarin studio does not launch because I don't have Mono.framework in my /Library/Frameworks path. I foolishly uninstalled and tried (and failed) when I first discovered Xamarin not working.
I've looked all over, and I've found plenty of instructions for how to compile Mono itself (done) but nothing which tells me how to build and install Mono.framework
I've also tried installing the Mono MDK from the package, then overwriting it's binaries with my custom built ones, but when I do this Xamarin studio fails to launch telling me I don't have the Mono MDK installed.
Can anyone help me out? Thanks
Unfortunately it doesn't appear there is a repo available to build/compile the framework from source. The current Mono MDK package located here only contains the Mono.framework along with the supporting install/uninstall scripts, etc.; current version:
MonoFramework-MDK-4.0.2.5.macos10.xamarin.x86.pkg
The Mono.framework should install to /Library/Frameworks.
If that is indeed the one you've downloaded and installed I would then verify that it has copied the Mono.framework bundle (571.6 MB) into the frameworks directory, open up Console.app then launch Xamarin. If Xamarin doesn't launch again then I would recommend posting the error message here and proceed from there.
Another option is extract the Mono.framework out of the .pkg and manually install it.
You might already have found a solution, but in case somebody else finds this thread; Mono has made a preview version that supports El Capitan:
http://www.mono-project.com/download/

Pycharm 4.5 CE crashes on launch on OS X 10.8.5

I upgraded from Pycharm 4.0 (which worked fine) to 4.5 community edition on Mac OS 10.8.5.
It crashes on launch after bouncing a bit in the dock.
The log files, console, all show nothing.
I'm running java 1.6.0_65, and have Python 2.7, Jython, PyPy via Macports.
Any ideas?
Make sure you've installed Apple's Java for OS X 2014-001 (at least).
Try to delete ~/Library/Java/Extensions, see the issue IDEA-137147.
Similar to the answer for IntelliJ IDEA, if you can't delete ~/Library/Java/Extensions, i.e., because you need it's contents (likely JAI jars) as part of other applications, you can create a file, pycharm.vmoptions in ~/Library/Preferences/PyCharm40 with contents:
-Djava.ext.dirs=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext
to override OSX Java 6's default behavior of checking the user's ~/Library/Java/Extensions directory in addition to the system's extensions on application start up; but only for PyCharm.

Issue completing the install script for pkgin/pkgsrc for OSX 10.7, segfault running pkgin

In attempting to install pkgin/pkgsrc (NetBSD-based package managment tools), using the saveosx.org instructions and github repository.
The repository has installation instructions, which I followed, up to the point of a specific but uninformative error:
It looks like there was an issue running: sudo /usr/pkg/bin/pkgin -y update
I tried running this file directly, but my terminal reports a segmentation fault.
I'm running OSX 10.7.5 and have Xcode-Command-Line Tools installed, but I find no information about Darwin version compatibility on NetBSD's site. My searches have revealed no one else reporting issues using pkgin.
Version 5.0+ is supported according to www.netbsd.org/docs/pkgsrc/platforms.html#darwin, which according to wikipedia (en.wikipedia.org/wiki/Darwin_%28operating_system%29#Release_history) corresponds to OSX 10.1.1+
What options do I have besides upgrading my operating system and hoping the problem is fixing by having newer libraries or a newer kernel?
For reference:
www.pkgsrc.org/#docs
www.perkin.org.uk/pages/pkgsrc-binary-packages-for-osx.html
wiki.netbsd.org/pkgsrc/pkgsrc_64bit_osx/
Related question: Unable to run pkgin on Mac OSX
It would appear that the pkgin binary currently supplied by saveosx is compiled only for more recent OSX releases. It needs at least a Darwin-14.x kernel, or newer, so it won't even run on 10.9.5. Unfortunately the script fails to check the OSX version before it blindly tries to run the pkgin binary, causing the program to crash.
saveosx is basically a painfully obnoxious, rather ugly, and poorly implemented. set of scripts that are superfluous to actually using pkgsrc on OSX.
I would strongly recommend avoiding saveosx for the time being.
Instead I would recommend trying the following well supported alternative:
OSX binary pkgsrc packages
A 32-bit Snow Leopard version that runs on 10.6.8 and newer is available, and I just checked the distribution directory and I see some 2015Q1 i386 packages are just now available, still supporting 10.6.8:
2015Q1 32-bit (i386) Snow Leopard and newer pkgsrc bootstrap
You can of course also build your own pkgsrc bootstrap for any specific OSX environment:
pkgsrc home

Fail to install QGIS on my mac

I tried several times to install almost everything from the website, http://www.kyngchaos.com/software/qgis
However, when I open QGIS, the initial image just got stuck on the sentence "starting python" and then just quit automatically.
My mac OS version is 10.8.5
Is such a problem due to my two versions of python in my system? The python in my system is 2.7.5, and perviously I also installed a standard version of python which is about 3.3. Then I realize that I could just use the 2.7 one instead, so I just dragged the whole fold named "python" from my application folder into trashcan and use the 2.7 from terminal instead. But I'm afraid that doesn't work either...
And how can I install the QGIS correctly now? the process seems to messy to me as a beginner...

confused about macports

I am using MacBook Pro Mac OS 10.5 with related version of XCode. I am new to this development environment. I am learning macports, and I read information about macports from http://www.macports.org/. But I am still confused what macports is after reading information from this site.
I am previous working on Windows and Linux, could anyone let me know what macports is (in easy words) and what is the similar item on Windows/Linux?
thanks in avdance,
George
macports is a way of getting executables and other compiled code installed on your computer without having to work out the details of compiling/linking each apllication.
It is equivalent to a package manager under Linux and other Unicies. There is no direct equivalent under Windows.
It is just a convenient way to install a lot of *nix soft on your mac book. They are installed separately (not overwriting) from binaries/daemons/libs already installed on your mac (by default in folder /opl/local). Also they are much fresher than those installed on your mac.
For example 10.6 ships with bash 3.2, but after running sudo port install bash, you will get version 4.x (to make it your default shell add /opt/local/bin/bash to file /private/etc/shells, run chsh -s /opt/local/bin/bash and reopen terminal).
Note other os x package managers: fink and homebrew (superuser question)

Resources