'Python shebang line not working - how to cleanup python
I'm trying to learn some Python to make my life easier with some scripts.
I've created a script, which uses tKinter. Unfortunately, there is a bug in the Python 3.9 and the installed version via Brew (on MacOS 12). I've looked up and seems the only way to fix this, is to install the Python directly from Python.org
I've done this and it fixed my issue. As mentioned in the title, the script is only running, when I "hard" link the interpreter in the shebang line
#!/Library/Frameworks/Python.framework/Versions/3.10/bin/python3
I've I use #!/usr/bin/env python3 the bug occurs again (black tk window).
So, from a beginner's perspective, I can't figure out what is missing. The only thing I would assume is that my old Brew install (which I uninstalled)
I also cleaned the hash
% env python -V
Python 3.10.4
% python -V
Python 3.10.4
% /usr/bin/env python -V
Python 3.10.4
% cat .bash_profile
alias python='python3'
PYTHONPATH="/Library/Frameworks/Python.framework/Versions/3.10/bin/python3"
export PYTHONPATH
% echo $PATH | sed 's/:/\n/g' | sort | uniq -c
1 /Library/Apple/usr/bin
1 /Library/Frameworks/Python.framework/Versions/3.10/bin
1 /bin
1 /opt/X11/bin
1 /opt/homebrew/bin
3 /opt/homebrew/opt/[email protected]/bin
1 /opt/homebrew/sbin
1 /sbin
1 /usr/bin
1 /usr/local/bin
1 /usr/sbin
% declare -p PATH
export -T PATH path=( /opt/homebrew/opt/[email protected]/bin /opt/homebrew/opt/[email protected]/bin /opt/homebrew/opt/[email protected]/bin /Library/Frameworks/Python.framework/Versions/3.10/bin /opt/homebrew/bin /opt/homebrew/sbin /usr/local/bin /usr/bin /bin /usr/sbin /sbin /opt/X11/bin /Library/Apple/usr/bin )
%
Is my Path variable the problem of it? How would I clean it?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
