This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: 'readline' module fails to build on OS X - some recent change broke it
Type: Stage:
Components: Build, macOS Versions: Python 3.1, Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: ronaldoussoren Nosy List: l0nwlf, ned.deily, ronaldoussoren
Priority: normal Keywords:

Created on 2010-04-11 02:21 by l0nwlf, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (4)
msg102807 - (view) Author: Shashwat Anand (l0nwlf) Date: 2010-04-11 02:21
'readline' module fails to build on OS X  in case of trunk and python 3.x. It have no issues with python 2.5 and 2.6 and python 2.7 alpha.

Here is the trace after running ./configure; make in trunk

Python build finished, but the necessary bits to build these modules were not found:
bsddb185           dl                 gdbm            
imageop            linuxaudiodev      ossaudiodev     
readline           spwd               sunaudiodev  

With that the uparrow-downarrow and other features fails which I suppose depends on 'readline'

07:31:51 l0nwlf-MBP:python-svn $ ./python.exe 
Python 2.7b1+ (trunk:79945M, Apr 11 2010, 07:14:54) 
[GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> t = 'test'      
>>> ^[[A^[[A^[[B^[[B

07:32:53 l0nwlf-MBP:CoreHD $ python3.2
Python 3.2a0 (py3k:79532, Apr  1 2010, 01:48:52) 
[GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import readline
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named readline
>>> t = 'test'
>>> ^[[A^[[A

(pressing up-arrow for repeating the previous command fails)

However, an interesting observation is, 

07:34:00 l0nwlf-MBP:CoreHD $ python2.7
Python 2.7a4+ (trunk:78750, Mar  7 2010, 08:09:00) 
[GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import readline
>>> t = 'test'
>>> t = 'test'
 
No such issue here, 'uparrow' is working, thereby completing the previous command on interpretor. The version is python2.7 alpha as you can see. So I assume some recent changes broke something, it was fine earlier.
msg102808 - (view) Author: Shashwat Anand (l0nwlf) Date: 2010-04-11 02:57
After I recompiled my older revision the 'readline' module failed to build. So I guess this is not python-related issue, rather something to do with my system.

08:17:47 l0nwlf-MBP:python-svn(rev79372) $ ./python.exe -V
Python 2.7a4+
08:17:53 l0nwlf-MBP:python-svn(rev79372) $ ./python.exe 
Python 2.7a4+ (trunk:79372, Apr 11 2010, 08:15:12) 
[GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import readline
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named readline

I will try looking for the cause behind it.
msg102812 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2010-04-11 07:09
Issue6877 (and subsequent fixes in Issue8066) allows the Python readline module to be built and linked with the OS X editline (libedit) library rather than with the GNU readline library (which is not included with OS X).  However, the libedit included in versions of OS X prior to 10.5 is considered too broken to use here.

By default, if you do not specify an --with-universal-archs other than "32-bit" to configure or if you do not explicitly set MACOSX_DEPLOYMENT_TARGET to another value, configure defaults to using "10.4" (or earlier) so the building of the readline module is skipped.  You can check this:

>>> from distutils.sysconfig import get_config_var 
>>> get_config_var('MACOSX_DEPLOYMENT_TARGET')
'10.4'

(Whether this is the best default is another question.)

As it stands, to be able to build the readline module, either:

(1) supply the GNU readline library as a local library, or

(2) ensure you are building with a deployment target of at least 10.5.  For example:

    ./configure MACOSX_DEPLOYMENT_TARGET=10.6 ; make

Also note that option (2) is not available for 3.1.x since the changes to support editline/libedit were not ported to it; they are, however, in 2.6.5, 2.7 (trunk), and 3.2 (py3k).
msg102817 - (view) Author: Shashwat Anand (l0nwlf) Date: 2010-04-11 09:06
./configure MACOSX_DEPLOYMENT_TARGET=10.6 ; make does the trick.
However it should be done by default rather than being defined explicitly.
Closing the issue.
History
Date User Action Args
2022-04-11 14:56:59adminsetgithub: 52612
2010-04-11 09:06:47l0nwlfsetstatus: open -> closed
2010-04-11 09:06:24l0nwlfsetmessages: + msg102817
2010-04-11 07:09:36ned.deilysetnosy: + ned.deily
messages: + msg102812

assignee: ronaldoussoren
components: + macOS
2010-04-11 02:57:36l0nwlfsetmessages: + msg102808
2010-04-11 02:21:17l0nwlfcreate