[MacPorts] #45301: spacebar not recognized in python macport version
#45301: spacebar not recognized in python macport version -----------------------------------+-------------------------------- Reporter: manzotti.alessandro@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Keywords: | Port: -----------------------------------+-------------------------------- My problem is that when I run a python version, obtained through macport, from the bash the spacebar is not recognized in the python shell. When I press the spacebar I just hear the beep sound. Using different shell does not seem to solve the problem. This does NOT happen when I compile Python from source or when I used the python already installed in the system. I am running OSX 10.9.5. I compiled different python version and they work fine so it does not seem to be related to the version of python I am using. And it happen only with python/ipython I have never seen this problem with other application or in my bash. It seems to be something related to how Macport python is compiled (maybe some libreadline issue?). For example this version I compiled does not have the problem {{{ otool -L /Users/alessandromanzotti/Python2.7.8/bin/python2.7 /Users/alessandromanzotti/Python2.7.8/bin/python2.7: /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 855.17.0) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 2577.0.0) }}} And also the system python works fine {{{ otool -L /usr/bin/python /usr/bin/python: /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 855.14.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1) }}} But all the macport version show the same problem {{{ otool -L /opt/local/bin/python /opt/local/bin/python: /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1) }}} -- Ticket URL: <https://trac.macports.org/ticket/45301> MacPorts <http://www.macports.org/> Ports system for OS X
#45301: spacebar not recognized in python macport version ------------------------------------+-------------------------------- Reporter: manzotti.alessandro@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: | ------------------------------------+-------------------------------- Comment (by larryv@…): This is almost certainly a problem with your setup. I don’t experience this problem, and this the first time I’ve ever heard of this happening. What does this tell you? {{{ ( cd /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /lib-dynload otool -L {_curses,_curses_panel,readline}.so ) }}} -- Ticket URL: <https://trac.macports.org/ticket/45301#comment:1> MacPorts <http://www.macports.org/> Ports system for OS X
#45301: spacebar not recognized in python macport version ------------------------------------+-------------------------------- Reporter: manzotti.alessandro@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: | ------------------------------------+-------------------------------- Comment (by manzotti.alessandro@…): Replying to [comment:1 larryv@…]:
This is almost certainly a problem with your setup. I don’t experience this problem, and this the first time I’ve ever heard of this happening.
What does this tell you? {{{ ( cd /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /lib-dynload otool -L {_curses,_curses_panel,readline}.so ) }}}
Thanks I agree. But it still does not happen with python compile in a different way. {{{ _curses.so: /opt/local/lib/libncurses.5.dylib (compatibility version 5.0.0, current version 5.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1) _curses_panel.so: /opt/local/lib/libpanel.5.dylib (compatibility version 5.0.0, current version 5.0.0) /opt/local/lib/libncurses.5.dylib (compatibility version 5.0.0, current version 5.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1) readline.so: /opt/local/lib/libedit.0.dylib (compatibility version 1.0.0, current version 1.42.0) /opt/local/lib/libncurses.5.dylib (compatibility version 5.0.0, current version 5.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1) }}} -- Ticket URL: <https://trac.macports.org/ticket/45301#comment:2> MacPorts <http://www.macports.org/> Ports system for OS X
#45301: spacebar not recognized in python macport version ------------------------------------+-------------------------------- Reporter: manzotti.alessandro@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: | ------------------------------------+-------------------------------- Comment (by manzotti.alessandro@…): I noticed that I do not have the readline library in the python version that does not show the problem. {{{ /Python2.7.5/lib/python2.7/lib-dynload$ otool -L {_curses,_curses_panel,readline}.so _curses.so: /usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 2577.0.0) _curses_panel.so: /usr/lib/libpanel.5.4.dylib (compatibility version 5.4.0, current version 5.4.0) /usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 2577.0.0) error: otool: can't open file: readline.so (No such file or directory) }}} Maybe this tells something? -- Ticket URL: <https://trac.macports.org/ticket/45301#comment:3> MacPorts <http://www.macports.org/> Ports system for OS X
#45301: spacebar not recognized in python macport version ------------------------------------+-------------------------------- Reporter: manzotti.alessandro@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: | ------------------------------------+-------------------------------- Comment (by larryv@…): Can’t say I know where to go from here. I suggest emailing [[MailingLists |macports-users]] to tap a wider audience. -- Ticket URL: <https://trac.macports.org/ticket/45301#comment:4> MacPorts <http://www.macports.org/> Ports system for OS X
#45301: spacebar not recognized in python macport version ------------------------------------+-------------------------------- Reporter: manzotti.alessandro@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: | ------------------------------------+-------------------------------- Comment (by nad@…): This doesn't ring a bell with me, either. Just to confirm, by Python shell, you mean something like: {{{ $ /opt/local/bin/python2.7 Python 2.7.8 (default, Oct 4 2014, 09:21:32) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.51)] on darwin Type "help", "copyright", "credits" or "license" for more information.
}}} And typing space here gives the beep? If so, the most likely explanation is an incompatible command in either a `PYTHONSTARTUP` file (https://docs.python.org/2/using/cmdline.html#envvar-PYTHONSTARTUP) or in the `libedit` `.editrc` file (https://developer.apple.com/library/mac/documentation/Darwin/Reference/Manpa...). Python can be linked with either BSD `editline (libedit)` (the default on OS X), GNU `readline`, or with neither. Keep in mind that the syntax of configuration command for `libedit` are different than those for GNU `readline` (https://docs.python.org/2/library/readline.html). If you want to use GNU `readline` with the MacPorts Python, you can `port install py27-readline`. -- Ticket URL: <https://trac.macports.org/ticket/45301#comment:5> MacPorts <http://www.macports.org/> Ports system for OS X
#45301: spacebar not recognized in python macport version ------------------------------------+-------------------------------- Reporter: manzotti.alessandro@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: | ------------------------------------+-------------------------------- Comment (by manzotti.alessandro@…): Hi all thanks for the help. The problem is exactly with the py27-readline package. When I install it I have the problem which disappears once I uninstall it. That is installed because I need Ipython that depends on it. Is there a way to try to force ipython to use libedit instead of gnureadline? Or does anyone know what the problem with the py27-gnureadline package could be? Thanks -- Ticket URL: <https://trac.macports.org/ticket/45301#comment:6> MacPorts <http://www.macports.org/> Ports system for OS X
#45301: spacebar not recognized in python macport version ------------------------------------+-------------------------------- Reporter: manzotti.alessandro@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: | ------------------------------------+-------------------------------- Comment (by nad@…): Have you checked whether you define a `PYTHONSTARTUP` environment variable that has editline specific commands in it? Try `python -E` to ignore env variables and see if that works. Also check what terminal def is in use: `echo $TERM`. For what it's worth, it is possible to write a python startup file (pointed to by `PYTHONSTARTUP`) that will work with Python 2.7.x or 3.x and with Pythons using either `libedit` or GNU `readline`. For example: {{{ from pprint import pprint as pp try: import readline import rlcompleter if 'libedit' in readline.__doc__: readline.parse_and_bind("bind ^I rl_complete") else: readline.parse_and_bind("tab: complete") except ImportError: pass }}} -- Ticket URL: <https://trac.macports.org/ticket/45301#comment:7> MacPorts <http://www.macports.org/> Ports system for OS X
#45301: spacebar not recognized in python macport version ------------------------------------+-------------------------------- Reporter: manzotti.alessandro@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: | ------------------------------------+-------------------------------- Comment (by manzotti.alessandro@…): No I do not think it has nothing to do with my PYTHONSTARTUP file. The error is independent of that and it is there even with python -E. My $TERM is xterm-256color Thanks -- Ticket URL: <https://trac.macports.org/ticket/45301#comment:8> MacPorts <http://www.macports.org/> Ports system for OS X
#45301: spacebar not recognized in python macport version ------------------------------------+-------------------------------- Reporter: manzotti.alessandro@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: | ------------------------------------+-------------------------------- Comment (by nad@…): Ah, one last thought: make sure Python is really importing the right `readline.so` and check the library dependencies on it with `otool -L`. I forgot that `py27-readline` installs its own version of `readline.so` (in `site-packages/readline`) and then does some fancy `sys.path` manipulation at Python startup to ensure that its `readline.so` is found before the standard library `readline.so` (linked with libedit). {{{
import readline readline.__file__ '/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/readline/readline.so'
$ otool -L '/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/readline/readline.so' /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/readline/readline.so: /opt/local/lib/libncurses.5.dylib (compatibility version 5.0.0, current version 5.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0 }}} Note that the `py27-readline` `readline.so` is statically linked with GNU `readline`. -- Ticket URL: <https://trac.macports.org/ticket/45301#comment:9> MacPorts <http://www.macports.org/> Ports system for OS X
#45301: spacebar not recognized in python macport version ------------------------------------+-------------------------------- Reporter: manzotti.alessandro@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: | ------------------------------------+-------------------------------- Comment (by nad@…): Added: you may just need to rebuild/reinstall `py27-readline` or perhaps, if you are using a binary package, the binary package is too old. It needs to be rebuilt when `python27` is updated. I build all my MacPorts packages from source so I wouldn't see that kind of problem. -- Ticket URL: <https://trac.macports.org/ticket/45301#comment:10> MacPorts <http://www.macports.org/> Ports system for OS X
#45301: spacebar not recognized in python macport version ------------------------------------+-------------------------------- Reporter: manzotti.alessandro@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: | ------------------------------------+-------------------------------- Comment (by manzotti.alessandro@…): I have the same, with a slight older version of libSystem.B.dylib {{{ otool -L /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/readline/readline.so /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/readline/readline.so: /opt/local/lib/libncurses.5.dylib (compatibility version 5.0.0, current version 5.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1) }}} I have uninstalled and installed py27-readline several times. plus in my mac port config I forced it to build everything from source. If there is something I can do manually I can try. -- Ticket URL: <https://trac.macports.org/ticket/45301#comment:11> MacPorts <http://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts