Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly locate macos python.org built-in tcl/tk #5013

Merged
merged 1 commit into from Sep 28, 2020

Conversation

ssantichaivekin
Copy link
Contributor

The python.org OS X python distributions installs a built-in version tcl/tk in a path similar to the system installation. This makes pyinstaller confused and think the python.org built-in tcl/tk is the system installation. This pull request fixes this issue. See #3753 (comment) .

Resolves #3753 .

@bwoodsend
Copy link
Member

@ssantichaivekin Sorry for the silence. Thanks for working on this. If this works then it will solve several issues.

@reritom, @amifunny, could you pip install https://github.com/ssantichaivekin/pyinstaller/archive/tcl-tk-macos-bugfix.zip and verify that tkinter works? You can use our go-to hello work tkinter script:

import tkinter
from tkinter import ttk

root = tkinter.Tk()

msg = ttk.Label(root, text='It\'s working just fine.')

msg.grid()

root.mainloop()

@nbrummel - This may fix your #5040 too. Could you try it also with your code?

@amifunny
Copy link

@bwoodsend Yes, working fine but large amount of warnings are displayed while packing like -

2220 WARNING: Several hooks defined for module 'astor'.Please take care they do not conflict.
2220 WARNING: Several hooks defined for module 'astroid'.Please take care they do not conflict.
2225 WARNING: Several hooks defined for module 'astropy'.Please take care they do not conflict.

For every global installed package.

@ssantichaivekin
Copy link
Contributor Author

I used the version with bugfix for my own project and it created a working executable for macOS Catalina 10.15 -- however, the shipped tkinter application executable does not work on my friend's macOS Mojave 10.14. I don't think this is pyinstaller trouble because my friend's macOS Mojave also crashes when running python -m tkinter using python from python.org. The problem is documented here: https://stackoverflow.com/questions/57435896/tkinter-crashes-computer-after-macos-10-14-6-update

@bwoodsend
Copy link
Member

bwoodsend commented Aug 12, 2020

I don't think this is pyinstaller trouble

That's a relief. That issue looks horrible. @ssantichaivekin Can I ask which Python version(s) you've tried this on? There's been some changes somewhere between Python 3.7 and 3.8.5 (I think) which has caused issues. Ideally I'd like this tested on 3.7.0 and whatever the latest 3.8.x currently is.

@amifunny Thanks for testing that. Those warnings are just because you have the hooks repo(s) installed and a PyInstaller from before Legorooj moved the hooks out of there into the hooks repos. It's not relevant to this issue.

Edit: On reading the commit message I see that this is your system Python in which case you probably can't change it. @amifunny Are you also using the system one?

@bwoodsend
Copy link
Member

@reritom @motatoes Could you both verify this works. Use:

pip3 install https://github.com/ssantichaivekin/pyinstaller/archive/tcl-tk-macos-bugfix.zip

Then try freezing this hello-world tk example.

@bwoodsend bwoodsend mentioned this pull request Aug 31, 2020
6 tasks
@bwoodsend
Copy link
Member

@Legorooj does this need a changelog entry? Other than that I think we can consider this tested and ready to merge.

Copy link
Member

@Legorooj Legorooj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! But we need a changelog entry of the bugfix category. Please create 2 identical entries with different filenames, one referring to this PR the other to the linked issue. See here for the changelog guide.

The python.org OS X python distributions installs a
built-in version tcl/tk in a path similar to the system
installation. This makes pyinstaller confused and
think the python.org built-in tcl/tk is the system installation.
This commit fixes the path to check to be more careful.
@Legorooj Legorooj merged commit 9fe4367 into pyinstaller:develop Sep 28, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problem with hook-_tkinter.py using Python3.7 on MacOS
5 participants