Running OS X 10.6.8 Snow Leopard I cannot input the scandinavian letters into the interpretive mode. The terminal bell sounds for every keystroke and nothing shows up. All letters show up as normal in the regular terminal environment. Inputting UTF8 characters works fine in the Terminal, when running a python script, in PyDev and in the REPL
Is there a problem with the interactive mode settings and these special characters?
I have installed and am running python 2.7.3 mainly, but the OS-provided Pythons have this problem too. (i.e when running python2.5 or python2.6 I still experience this problem.) I dont know if installing python 2.7 has changed some under library that it uses, maybe readline (I’m on thin ice here, guessing basically)?
It sounds like the problem here is that the python.org Python is expecting real
readline, and not being happy with thelibeditsubstitute that Apple provides.See the documentation for
readlineat PyPI for an explanation of the issue.You can fix it as follows:
Note that
readlineis one of the handful of things that cannot be installed properly bypip, so you have to useeasy_install(or do it manually).The python.org 2.x installers don’t come with
easy_install. Install it by following the directions on thesetuptoolspage.On top of that, keep in mind that, in some cases, you can end up with Apple-python
easy_installin/usr/local/binas well as/usr/bin, which means you can’t be sure/usr/local/bin/easy_installwill get thepython.orgversion, so explicitly useeasy_install-X.Y.And even that doesn’t help if you’re using a python.org (or other) installation of an X.Y version that Apple already gave you.
/usr/local/bin/easy_install-2.7may well be Apple’s (as it is on the 10.8.2 machine I’m sitting at right now). The only way to be safe is to check the shebang line and see which Python interpreter it uses.Or, more simply, just don’t install a python-X.Y if Apple’s already given you one. Seriously, there are hundreds of questions all over SO from people who did this and have problems, and all of them could be avoided by just using the Apple build. Apple used to ship broken, incomplete, and/or woefully out-of-date Python, but since either 10.5 or 10.6, they’ve been shipping working, complete, reasonably-recent versions, with extras like
easy_installandPyObjCincluded.