classification
Title: IDLE shell won't open on Mac OS 10.13.1
Type: behavior Stage: resolved
Components: IDLE, Installation, macOS Versions: Python 3.6
process
Status: closed Resolution: not a bug
Dependencies: Superseder: Unable to run IDLE without write-access to home directory
View: 8231
Assigned To: Nosy List: ned.deily, ronaldoussoren, sm1979, terry.reedy
Priority: normal Keywords:

Created on 2017-12-29 16:43 by sm1979, last changed 2018-01-02 15:15 by sm1979. This issue is now closed.

Messages (12)
msg309180 - (view) Author: Steve Margetts (sm1979) Date: 2017-12-29 16:43
I am trying to install Python on a Max running OS 10.13.1 (so my son can use a 'Coding for Beginners' book). Both 2.7 and 3.6 have the same problem: Clicking on IDLE leads to the icon bouncing a couple of times in the dock, but not opening a shell. I have tried re-installing and restarting post install. Typing python or python3.6 into the terminal seems to launch Python successfully (details below). I am as new to coding as my son, please phrase any advice accordingly!

Thank you.

Last login: Fri Dec 29 16:26:57 on ttys000
mkdir: /Users/Steve Margetts/.bash_sessions: Permission denied
touch: /Users/Steve Margetts/.bash_sessions/79B2448C-E769-409D-A67D-7A96F8C3C348.historynew: No such file or directory
iMac:~ Steve Margetts$ python
Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 12:01:12) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> help
Type help() for interactive help, or help(object) for help about object.
>>>

Last login: Fri Dec 29 16:30:16 on ttys000
mkdir: /Users/Steve Margetts/.bash_sessions: Permission denied
touch: /Users/Steve Margetts/.bash_sessions/5A516AB8-0481-4D55-A2BD-1B1017E52147.historynew: No such file or directory
iMac:~ Steve Margetts$ python3.6
Python 3.6.4 (v3.6.4:d48ecebad5, Dec 18 2017, 21:07:28) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
msg309194 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-12-29 20:46
IDLE uses Python's tcl/tk interface module, called 'tkinter'.  Tcl is a separate language and tk is its graphical user interface.  This is most likely the problem.  Did you follow the advice at
https://www.python.org/download/mac/tcltk/
to install tcl/tk 8.5.18?  Make sure you read the whole page.

To test better, run 'import tkinter' at Python's interactive '>>>' prompt.  Any error message?  If that works, run 'python3.6 -m idlelib' and/or 'python -m idlelib.idle' at the terminal '...$' prompt.  Does that display an error message?
msg309195 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2017-12-29 20:56
Those messages at the top of your terminal sessions are pretty suspicious, e.g. "Permission denied" and "No such file or directory".  They suggest a home directory ownership or permissions issue which you should investigate.  But definitely try running IDLE from the terminal window as Terry suggests.  If nothing else, you may see more informative error messages.
msg309226 - (view) Author: Steve Margetts (sm1979) Date: 2017-12-30 10:53
Thanks for the help. I've installed ActiveTCL 8.5.18.0 as per the Python recommendation. Running from terminal:

Last login: Fri Dec 29 16:46:22 on ttys001
mkdir: /Users/Steve Margetts/.bash_sessions: Permission denied
touch: /Users/Steve Margetts/.bash_sessions/224C387E-8E74-4020-A5CC-F275EFB79EAE.historynew: No such file or directory
iMac:~ Steve Margetts$ python3.6
Python 3.6.4 (v3.6.4:d48ecebad5, Dec 18 2017, 21:07:28) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tkinter
>>>

Did not bring up any error message. However, subsequently trying to run IDLE from terminal brought up:

Last login: Sat Dec 30 10:42:04 on ttys000
mkdir: /Users/Steve Margetts/.bash_sessions: Permission denied
touch: /Users/Steve Margetts/.bash_sessions/58F5E574-277D-4413-9B03-4B24ED9B4C21.historynew: No such file or directory
iMac:~ Steve Margetts$ python3.6 -m idlelib

 Warning: unable to create user config directory
/Users/Steve Margetts/.idlerc
 Check path and permissions.
 Exiting!

iMac:~ Steve Margetts$ 

Does this look like a permissions issue? If so, any idea what to try next? I'm logged on as an administrator on a home computer. Is this likely to be a security setting issue? Thanks again for any help - I'm a child of the GUI and the last time I coded anything was in BBC Basic!
msg309228 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2017-12-30 11:57
There appears to be a permission issue with the home directory.

What's the output of the following commands in a terminal window:

$ ls -led ~
$ id

The home directory should be owned by the "uid" shown by the second command, and should be writable by the user, the output of "ls" should show something like this:

drwxr-xr-x@ 336 ronald  staff  10752 Dec 30 12:52 /Users/ronald
 0: group:everyone deny delete

In particular the mode at the start should start with "drwx".
msg309231 - (view) Author: Steve Margetts (sm1979) Date: 2017-12-30 12:30
OK, those commands give:

iMac:~ Steve Margetts$ ls -led
drwxr-xr-x  21 501  staff  714 30 Dec 10:40 .
iMac:~ Steve Margetts$ id
uid=503(Steve Margetts) gid=20(staff) groups=20(staff),12(everyone),61(localaccounts),79(_appserverusr),80(admin),81(_appserveradm),98(_lpadmin),33(_appstore),100(_lpoperator),204(_developer),250(_analyticsusers),395(com.apple.access_ftp),398(com.apple.access_screensharing),399(com.apple.access_ssh)
iMac:~ Steve Margetts$
msg309238 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2017-12-30 16:33
Just to be sure, please try again with the command as Ronald requested, i.e. include the tilde "~":

ls -led ~
msg309239 - (view) Author: Steve Margetts (sm1979) Date: 2017-12-30 16:34
Including tilde...

Last login: Sat Dec 30 10:47:07 on ttys001
mkdir: /Users/Steve Margetts/.bash_sessions: Permission denied
touch: /Users/Steve Margetts/.bash_sessions/8B76B0D2-2C88-4FE0-A8F6-C7FB8C13A2A8.historynew: No such file or directory
iMac:~ Steve Margetts$ ls -led ~
drwxr-xr-x  21 501  staff  714 30 Dec 10:40 /Users/Steve Margetts
iMac:~ Steve Margetts$
msg309246 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2017-12-30 19:42
OK, that confirms that your home directory permissions are incorrect.  Not sure how that happened, possibly by an inadvertent chown command.  Note that you need to be careful when using shell commands because your user name has a space character in it, so you have to be sure to enclose it in quotes in the shell ("Steve Margetts") and there may be third-party scripts that don't handle that case well; generally, it's best to avoid using spaces in the Unix login name.  Anyway, there are several ways to correct the problem but it looks like the easiest might be to use a procedure that Apple provides to reset permissions.  It is described here:

https://www.macobserver.com/tmo/article/os-x-repair-home-folder-permissions

Good luck!
msg309248 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2017-12-30 19:59
P.S. You might consider creating a new account without the embedded space and moving your files there; it will probably cause other problems for you in the future.  I notice that the current System Preferences -> Users & Groups interface won't even let you create a login account with a space in it.
msg309252 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-12-30 20:18
The Mac issue is the inability to add .xyz directories to the home directory.  You can test a fix by entering 'mkdir .idlerc' at the terminal prompt.

The IDLE issue is that IDLE quits when it cannot create .idlerc. In this respect, this is a duplicate of #8231.  That this can happen after what seemed like a 'normal' install (on a home machine?) gives me a bit more impetus to work on that issue.
msg309373 - (view) Author: Steve Margetts (sm1979) Date: 2018-01-02 15:15
OK, so I created a profile for my son (single name without any spaces!) and that seems to allow both Python and IDLE to work fine. I'll try and sort out my profile slow time - it doesn't seem to be causing any other issues just now. Thanks for the guidance.
History
Date User Action Args
2018-01-02 15:15:27sm1979setmessages: + msg309373
2017-12-30 20:18:38terry.reedysetassignee: terry.reedy ->
superseder: Unable to run IDLE without write-access to home directory
messages: + msg309252
2017-12-30 19:59:20ned.deilysetmessages: + msg309248
2017-12-30 19:42:58ned.deilysetstatus: open -> closed
resolution: not a bug
messages: + msg309246

stage: resolved
2017-12-30 16:34:50sm1979setmessages: + msg309239
2017-12-30 16:33:42ned.deilysetmessages: + msg309238
2017-12-30 12:30:15sm1979setmessages: + msg309231
2017-12-30 11:57:07ronaldoussorensetmessages: + msg309228
2017-12-30 10:53:15sm1979setmessages: + msg309226
2017-12-29 20:56:36ned.deilysetmessages: + msg309195
2017-12-29 20:46:22terry.reedysetnosy: + ronaldoussoren, ned.deily
messages: + msg309194
components: + Installation, macOS
2017-12-29 16:43:59sm1979create