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
Mac installer shell updater script silently fails if default shell is fish #73262
Comments
I have a Mac running OS X 10.11.6, Python 3.5.2, and fish 2.3.1. I installed Python 3.6.0, and everything seemed to work fine. However, I typed "python3" in my shell and it started Python 3.5.2. I restarted my shell and typed "python3", and it still started Python 3.5.2. I ran "which python3" and it told me "/Library/Frameworks/Python.framework/Versions/3.5/bin/python3". I ran "echo $PATH" and it told me "/Library/Frameworks/Python.framework/Versions/3.5/bin", among other directories that seem unrelated to Python. I thought that maybe the installer updated my ~/.bash_profile, assuming that I am using bash like most people, but I looked in that file, and the only things affecting my path that look Python-related are adding the directories "/Library/Frameworks/Python.framework/Versions/2.7/bin" and "/Library/Frameworks/Python.framework/Versions/3.5/bin". I re-ran the installer, clicked the "Customize" button, made sure that the "Shell profile updater" checkbox was checked, and ran "python3", and it started Python 3.5.2. I can probably fix this by adding the right directory to my $PATH, but I think it is a bug if the installer doesn't make that change for me, or even try to make the change. |
Can you check what the permissions and ownership are on your existing .bash_profile file? Also, as you suspected, the installer's profile updater script does not currently look for fish initialization files. |
I just ran "ls -l ~/.bash_profile" and got the following output: -rw-r--r--+ 1 Elias staff 1057 Jul 2 11:04 /Users/Elias/.bash_profile |
Thanks for the info. The '+' is the ls output indicates there is extended security information for .bash_profile, probably an access control list entry that affects it. I suspect that might be the reason that .bash_profile does not get updated by the installer script; it seems to work for me but there are certainly a lot of different configurations the script has to deal with. Try "ls -le .bash_profile'. |
I just ran "ls -le ~/.bash_profile" and got this result: -rw-r--r--+ 1 Elias staff 1057 Jul 2 11:04 /Users/Elias/.bash_profile |
OK, that shouldn't be an issue. I'm just guessing at this point since nothing has changed in the profile updater script in a long time over many releases. I'm assuming you are running the installer under the same user name (Elias) and that Elias is an admin user. Fortunately, you can run the script manually since a copy is installed in /Applications/Python 3.6. Try double-clicking on the "Update Shell Profile.command" file there and see what shows up in the ensuing terminal window. If it now works, try restoring the original file: mv ~/.bash_profile.pysave ~/.bash_profile and rerun the installer and, and before quitting the installer, checking the installer log output (CMD-L and then selecting the all messages option) for clues. |
Ah! If you have made "fish" your default shell, the updater script should fail with the message "Sorry, I don't know how to patch ... shells". Perhaps your default shell was still bash back when you previously installed Python 3.5 and 2.7? If so, then the issue is simply that the updater script doesn't support fish. |
Ned, that sounds plausible. I think I started using fish after I installed Python 3.5, but before I installed Python 3.6. |
I've created a patch that applies fine to 3.7, 3.8 and 3.9, if anyone still is interested. (Backporting to 3.6 and 2.7 is probably not going to happen, but at least the patch applies fine to both of them.) The "Versions" label list should probably be updated to include 3.8 and 3.9. |
@erland: The attached patch looks fine to me. Could you convert it to a PR? |
Sure, I'll create a PR right away. |
Thanks for the PR! |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: