From unknown Sat Jun 21 12:18:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10227: Python installation fails for Python 3 Resent-From: Reuben Thomas Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-automake@gnu.org Resent-Date: Mon, 05 Dec 2011 22:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 10227 X-GNU-PR-Package: automake X-GNU-PR-Keywords: To: 10227@debbugs.gnu.org X-Debbugs-Original-To: bug-automake Received: via spool by submit@debbugs.gnu.org id=B.132312566517652 (code B ref -1); Mon, 05 Dec 2011 22:55:02 +0000 Received: (at submit) by debbugs.gnu.org; 5 Dec 2011 22:54:25 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RXhQW-0004ae-Rz for submit@debbugs.gnu.org; Mon, 05 Dec 2011 17:54:25 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RXhQU-0004aX-BV for submit@debbugs.gnu.org; Mon, 05 Dec 2011 17:54:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RXhPu-00070i-NI for submit@debbugs.gnu.org; Mon, 05 Dec 2011 17:53:47 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:35751) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RXhPu-00070Y-Lf for submit@debbugs.gnu.org; Mon, 05 Dec 2011 17:53:46 -0500 Received: from eggs.gnu.org ([140.186.70.92]:59529) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RXhPt-00059k-It for bug-automake@gnu.org; Mon, 05 Dec 2011 17:53:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RXhPs-00070I-Cq for bug-automake@gnu.org; Mon, 05 Dec 2011 17:53:45 -0500 Received: from exprod7og112.obsmtp.com ([64.18.2.177]:45931) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1RXhPs-00070C-0l for bug-automake@gnu.org; Mon, 05 Dec 2011 17:53:44 -0500 Received: from mail-fx0-f44.google.com ([209.85.161.44]) (using TLSv1) by exprod7ob112.postini.com ([64.18.6.12]) with SMTP ID DSNKTt1Ldns5Er/A98iOKeywm4SKZKBkGTk7@postini.com; Mon, 05 Dec 2011 14:53:43 PST Received: by mail-fx0-f44.google.com with SMTP id s1so1806887faa.17 for ; Mon, 05 Dec 2011 14:53:42 -0800 (PST) MIME-Version: 1.0 Received: by 10.227.208.81 with SMTP id gb17mr106811wbb.26.1323125621996; Mon, 05 Dec 2011 14:53:41 -0800 (PST) Received: by 10.180.24.135 with HTTP; Mon, 5 Dec 2011 14:53:41 -0800 (PST) Date: Mon, 5 Dec 2011 23:53:41 +0100 Message-ID: From: Reuben Thomas Content-Type: text/plain; charset=ISO-8859-1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -6.2 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) The code currently used to get the python package directory is wrong for Python 3: >>> from distutils import sysconfig; print (sysconfig.get_python_lib(0,0,'/usr/local'))/usr/local/lib/python3/dist-packages is wrong (should be /usr/local/lib/python3.2/dist-packages). Now, in some sense this must be right (since the path is returned by sysconfig), but the path produced (/usr/local/lib/python3/dist-packages) is not searched by my Ubuntu system's installed Python. If instead of automake I install the same files with distutils (using a suitable setup.py), then the files are installed in the right place (/usr/local/lib/python3.2/dist-packages). One solution would be to use the sysconfig module (not distutils.sysconfig), but that only works in Python 2.7 and 3.2 (not 3.0 or 3.1), so isn't really a starter. Hopefully someone who knows more about Python than I can help, as it's much nicer to have Python modules installed from one extra line in Makefile.am than have to add a whole extra setup.py and require a different tool (albeit one bundled with Python) to be used. (Actually, that is another idea: how about delegating to distutils, since it comes with every version of Python supported by automake?) -- http://rrt.sc3d.org From unknown Sat Jun 21 12:18:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10227: Python installation fails for Python 3 Resent-From: Roumen Petrov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-automake@gnu.org Resent-Date: Mon, 05 Dec 2011 23:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10227 X-GNU-PR-Package: automake X-GNU-PR-Keywords: To: 10227@debbugs.gnu.org Received: via spool by 10227-submit@debbugs.gnu.org id=B10227.132312703922514 (code B ref 10227); Mon, 05 Dec 2011 23:18:01 +0000 Received: (at 10227) by debbugs.gnu.org; 5 Dec 2011 23:17:19 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RXhmg-0005r4-MN for submit@debbugs.gnu.org; Mon, 05 Dec 2011 18:17:19 -0500 Received: from rila.superhosting.bg ([91.196.124.212]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RXhmd-0005qw-Vm for 10227@debbugs.gnu.org; Mon, 05 Dec 2011 18:17:17 -0500 Received: from [78.128.48.21] (helo=[192.168.0.10]) by rila.superhosting.bg with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1RXhm3-000dyp-W6 for 10227@debbugs.gnu.org; Tue, 06 Dec 2011 01:16:40 +0200 Message-ID: <4EDD50D5.6040400@roumenpetrov.info> Date: Tue, 06 Dec 2011 01:16:37 +0200 From: Roumen Petrov User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.19) Gecko/20110430 SeaMonkey/2.0.14 MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - rila.superhosting.bg X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roumenpetrov.info X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: -3.6 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.5 (---) Reuben Thomas wrote: > The code currently used to get the python package directory is wrong > for Python 3: > >>>> from distutils import sysconfig; print (sysconfig.get_python_lib(0,0,'/usr/local'))/usr/local/lib/python3/dist-packages >>>> > is wrong (should be /usr/local/lib/python3.2/dist-packages). Now, in > some sense this must be right (since the path is returned by > sysconfig), but the path produced > (/usr/local/lib/python3/dist-packages) is not searched by my Ubuntu > system's installed Python. If instead of automake I install the same > files with distutils (using a suitable setup.py), then the files are > installed in the right place (/usr/local/lib/python3.2/dist-packages). > It seems to me this is vendor bug as the right place is site-packages, see PEP 370. A cannot reproduce cut of version with "python" build from original sources, i.e. without extra patches : 2.6. 2.7 3.2 return .../pythonX.Y/site-packages [SNIP] Roumen From unknown Sat Jun 21 12:18:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10227: Python installation fails for Python 3 Resent-From: Stefano Lattarini Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-automake@gnu.org Resent-Date: Wed, 21 Nov 2012 13:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10227 X-GNU-PR-Package: automake X-GNU-PR-Keywords: To: Roumen Petrov Cc: 10227@debbugs.gnu.org, Reuben Thomas Received: via spool by 10227-submit@debbugs.gnu.org id=B10227.1353505378517 (code B ref 10227); Wed, 21 Nov 2012 13:43:01 +0000 Received: (at 10227) by debbugs.gnu.org; 21 Nov 2012 13:42:58 +0000 Received: from localhost ([127.0.0.1]:58363 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TbAZs-00008D-VD for submit@debbugs.gnu.org; Wed, 21 Nov 2012 08:42:58 -0500 Received: from mail-bk0-f44.google.com ([209.85.214.44]:62799) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TbAZq-000084-QA for 10227@debbugs.gnu.org; Wed, 21 Nov 2012 08:42:56 -0500 Received: by mail-bk0-f44.google.com with SMTP id w11so3169930bku.3 for <10227@debbugs.gnu.org>; Wed, 21 Nov 2012 05:41:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=V/Eki2EFRl6+XAsG4X7fMK67nXMJwrTgwPaLhsWKsSw=; b=Xf8Kw9+opRDh1+Z8LC4yERNZMjpjRkgZMII/Y2TqPn4sIpR/QatUEB5x0r+vy8R4k8 iS3WzoLrGjJvvEhWBICfeG5Onb9ZOJNhafSy1VqThsnKRJu+/WAbNRGOocfEHgxzF/rt hK47pRXyQGSt0lk5JcyQvgMEQj8ffev0SHBghg26Fzlw33v/2qQKl7kSD+jr7HA7fawt bxtz0hVcpHn+taztDf05UoDhuSdg0Iw+56Dn4v2xPrIjAinKS/clM/K0f0s6CKGoyaOb dlKBUVYoESgPGVcxS7fpbVyTQqCVypQ30+nOAN1AyZcBHQpvVRIXhC2xAzMVLYdqjcS+ +qig== Received: by 10.204.130.210 with SMTP id u18mr6970515bks.129.1353505299200; Wed, 21 Nov 2012 05:41:39 -0800 (PST) Received: from [192.168.178.21] (host247-100-dynamic.8-87-r.retail.telecomitalia.it. [87.8.100.247]) by mx.google.com with ESMTPS id e22sm137592bke.14.2012.11.21.05.41.37 (version=SSLv3 cipher=OTHER); Wed, 21 Nov 2012 05:41:38 -0800 (PST) Message-ID: <50ACDA0E.9040004@gmail.com> Date: Wed, 21 Nov 2012 14:41:34 +0100 From: Stefano Lattarini MIME-Version: 1.0 References: <4EDD50D5.6040400@roumenpetrov.info> In-Reply-To: <4EDD50D5.6040400@roumenpetrov.info> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.1 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.1 (/) tags 10227 + moreinfo thanks Hi Roumen, Reuben. On 12/06/2011 12:16 AM, Roumen Petrov wrote: > Reuben Thomas wrote: >> The code currently used to get the python package directory is wrong >> for Python 3: >> >>>>> from distutils import sysconfig; print (sysconfig.get_python_lib(0,0,'/usr/local'))/usr/local/lib/python3/dist-packages >>>>> >> is wrong (should be /usr/local/lib/python3.2/dist-packages). Now, in >> some sense this must be right (since the path is returned by >> sysconfig), but the path produced >> (/usr/local/lib/python3/dist-packages) is not searched by my Ubuntu >> system's installed Python. If instead of automake I install the same >> files with distutils (using a suitable setup.py), then the files are >> installed in the right place (/usr/local/lib/python3.2/dist-packages). >> > It seems to me this is vendor bug as the right place is site-packages, see PEP 370. > > A cannot reproduce cut of version with "python" build from original sources, > i.e. without extra patches : > 2.6. 2.7 3.2 return .../pythonX.Y/site-packages > > > [SNIP] > > Roumen > I'm going through old open bugs, and I've noticed this one. Is the problem still present, after the recent updates to the python support? (They should be already merged in the maint branch by now) If yes, could you please provide me with a minimal, clear reproducer, or at least restart this discussion from the basics? Thanks, Stefano From unknown Sat Jun 21 12:18:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10227: Python installation fails for Python 3 Resent-From: Reuben Thomas Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-automake@gnu.org Resent-Date: Wed, 21 Nov 2012 18:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10227 X-GNU-PR-Package: automake X-GNU-PR-Keywords: To: Stefano Lattarini Cc: 10227@debbugs.gnu.org, Roumen Petrov Received: via spool by 10227-submit@debbugs.gnu.org id=B10227.13535208081173 (code B ref 10227); Wed, 21 Nov 2012 18:01:01 +0000 Received: (at 10227) by debbugs.gnu.org; 21 Nov 2012 18:00:08 +0000 Received: from localhost ([127.0.0.1]:59456 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TbEam-0000Ir-7W for submit@debbugs.gnu.org; Wed, 21 Nov 2012 13:00:08 -0500 Received: from exprod7og122.obsmtp.com ([64.18.2.22]:33721) by debbugs.gnu.org with smtp (Exim 4.72) (envelope-from ) id 1TbEaj-0000IM-HR for 10227@debbugs.gnu.org; Wed, 21 Nov 2012 13:00:06 -0500 Received: from mail-ea0-f200.google.com ([209.85.215.200]) (using TLSv1) by exprod7ob122.postini.com ([64.18.6.12]) with SMTP ID DSNKUK0WWPujDaZchmlgDPk1t50AAEMKe/02@postini.com; Wed, 21 Nov 2012 09:58:49 PST Received: by mail-ea0-f200.google.com with SMTP id j13so5529250eaa.3 for <10227@debbugs.gnu.org>; Wed, 21 Nov 2012 09:58:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-gm-message-state; bh=DWQ+Y16w9K9sW0cALv01j/VI+0eIyQVaSpEz1lRfLlQ=; b=oO+LtjPauEl8qv8g33b4+SltFFaeVNLJMvXHm9UI5PJI6ijOXpVQGA6zN1DpF3Wova ZsgkJwU2YY8cgPvzG/o1K5V72R8Y+ahFIkxxVi+S7oBpkxUT23BvXkuthIltReMTbsVJ EDfUOyHRPRCvysyXoPqHVA4N34Ysg8u50UGOsu7JdZwXPxYy5Gwq/zL6rReYR7cBpeWC +ZUubTifwTL3Aj1BiPKCosZq0XBZuN2B3SZSD/c/AYYS5Z7g1T+7QnVApgoIW/lPgJO5 s9v4i6Gb+rKyEy6gZhtyJhG5WTuxskXd+B9lZbfEEuomDdwKeISQ6FMwthytpPXxaQOI MRCw== Received: by 10.14.175.198 with SMTP id z46mr47831724eel.26.1353520728025; Wed, 21 Nov 2012 09:58:48 -0800 (PST) MIME-Version: 1.0 Received: by 10.14.175.198 with SMTP id z46mr47831717eel.26.1353520727950; Wed, 21 Nov 2012 09:58:47 -0800 (PST) Received: by 10.14.214.8 with HTTP; Wed, 21 Nov 2012 09:58:47 -0800 (PST) In-Reply-To: <50ACDA0E.9040004@gmail.com> References: <4EDD50D5.6040400@roumenpetrov.info> <50ACDA0E.9040004@gmail.com> Date: Wed, 21 Nov 2012 17:58:47 +0000 Message-ID: From: Reuben Thomas Content-Type: multipart/alternative; boundary=047d7b603e742f861504cf051a33 X-Gm-Message-State: ALoCoQk781VccENu0v2ikmwml3ziS8ZewyiUH2s5d44F+LMVQMxLGALh1uB4wG9XS6cJbm0UN/5yjy2NyES1AijylYYr0ccJ6LsiIxTiIABpoaQlvBJCV99aOwFzmmSRjIN4TuBG+OhfjHM2rJ3VzTuieP+9geRf0uf6C8vhuzq6X/e2Cwv/rUg= X-Spam-Score: -1.5 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.5 (-) --047d7b603e742f861504cf051a33 Content-Type: text/plain; charset=ISO-8859-1 On 21 November 2012 13:41, Stefano Lattarini wrote: > tags 10227 + moreinfo > thanks > > Hi Roumen, Reuben. > > I'm going through old open bugs, and I've noticed this one. Is the > problem still present, after the recent updates to the python support? > (They should be already merged in the maint branch by now) If yes, > could you please provide me with a minimal, clear reproducer, or at > least restart this discussion from the basics? > I've just checked out the maint branch of automake, and I still see exactly the same problem: in m4/python.m4 the code used to get the Python package directory is: am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" Assuming the default am_py_prefix of /usr/local, this gives: $ python3 Python 3.2.3 (default, Oct 19 2012, 19:53:16) [GCC 4.7.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from distutils import sysconfig; print (sysconfig.get_python_lib(0,0,'/usr/local')) /usr/local/lib/python3/dist-packages i.e. exactly the same incorrect result as before (the correct answer is: /usr/local/lib/python3.2/dist-packages on my Ubuntu 12.10 system). I'm sorry, I can't tell whether, as Roumen suggests, this is an Ubuntu packaging bug, or an automake bug. It seems to me that this is the sort of thing the pyconfigure people ought to know about. -- http://rrt.sc3d.org --047d7b603e742f861504cf051a33 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 21 November 2012 13:41, Stefano Lattarini <stefano.lattarini= @gmail.com> wrote:
tags 10227 + moreinfo
thanks

Hi Roumen, Reuben.

I'm going through old open bugs, and I've noticed this one. =A0= Is the
problem still present, after the recent updates to the python support?
(They should be already merged in the maint branch by now) =A0If yes,
could you please provide me with a minimal, clear reproducer, or at
least restart this discussion from the basics?

I've just checked out the maint branch of automake, and I still= see exactly the same problem: in m4/python.m4 the code used to get the Pyt= hon package directory is:

am_cv_python_pythondir=3D`$PYTHON -c "import sys; = from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(= 0,0,prefix=3D'$am_py_prefix'))"

A= ssuming the default am_py_prefix of /usr/local, this gives:

$ python3
Python 3.2.3 (default, Oct 19 = 2012, 19:53:16)=A0
[GCC 4.7.2] on linux2
Type "hel= p", "copyright", "credits" or "license" = for more information.
>>> from distutils import sysconfig; print (sysconfig.get_pyt= hon_lib(0,0,'/usr/local'))
/usr/local/lib/python3/dist-pa= ckages

i.e. exactly the same incorrect resul= t as before (the correct answer is:

/usr/local/lib/python3.2/dist-packages

on my Ubuntu 12.10 system). I'm sorry, I can't tell whethe= r, as Roumen suggests, this is an Ubuntu packaging bug, or an automake bug.= It seems to me that this is the sort of thing the pyconfigure people ought= to know about.

--
http://rrt.sc3d= .org
--047d7b603e742f861504cf051a33-- From unknown Sat Jun 21 12:18:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10227: Python installation fails for Python 3 Resent-From: Stefano Lattarini Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-automake@gnu.org Resent-Date: Thu, 22 Nov 2012 13:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10227 X-GNU-PR-Package: automake X-GNU-PR-Keywords: To: Reuben Thomas Cc: 10227@debbugs.gnu.org, Roumen Petrov Received: via spool by 10227-submit@debbugs.gnu.org id=B10227.135358936131264 (code B ref 10227); Thu, 22 Nov 2012 13:03:02 +0000 Received: (at 10227) by debbugs.gnu.org; 22 Nov 2012 13:02:41 +0000 Received: from localhost ([127.0.0.1]:60445 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TbWQR-00088B-Gr for submit@debbugs.gnu.org; Thu, 22 Nov 2012 08:02:40 -0500 Received: from mail-lb0-f172.google.com ([209.85.217.172]:44911) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TbWQN-00087x-1d; Thu, 22 Nov 2012 08:02:37 -0500 Received: by mail-lb0-f172.google.com with SMTP id y2so6830317lbk.3 for ; Thu, 22 Nov 2012 05:01:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=f1K/CdheYD3OQ74rTeg17ZybBIs7x9As6n0LphM4aYU=; b=Ruc8odaFxTfjLaaNlhnlyvG5daltIkZU4z6aE+hNvv4tvaHCTLoOsgb6NBGs2kyt4f P6iIbhQfQQWKgXrf7La/K/7SGRonaNxaR8gTvhn3gSGoGo9JXaYpvGFz5gQzYBMQ1/Yl dkXfSDSBPnbCeocu7BlyO3ohPBHJJYXOjg9pPqxdv7v/7Lp5kGYL01HTXDHSkimN7DEP 7C9dQojtr2511QwxGQYMVc7fRe0Ml2bJw2hcIn/YGQPRnZ2GAeSctF20HhblKfl1nQN2 QB+T3euQnQLGFdoAdNa1vAgAyYMDy/ailcAy0ePoRG3+7w5f8qTEh9zLGxkEUx2jgD4d dEjQ== Received: by 10.152.105.103 with SMTP id gl7mr459288lab.10.1353589271934; Thu, 22 Nov 2012 05:01:11 -0800 (PST) Received: from [192.168.178.21] (host247-100-dynamic.8-87-r.retail.telecomitalia.it. [87.8.100.247]) by mx.google.com with ESMTPS id et7sm1417091lbb.11.2012.11.22.05.01.09 (version=SSLv3 cipher=OTHER); Thu, 22 Nov 2012 05:01:10 -0800 (PST) Message-ID: <50AE2213.6030906@gmail.com> Date: Thu, 22 Nov 2012 14:01:07 +0100 From: Stefano Lattarini MIME-Version: 1.0 References: <4EDD50D5.6040400@roumenpetrov.info> <50ACDA0E.9040004@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.1 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) tags 10227 - moreinfo thanks On 11/21/2012 06:58 PM, Reuben Thomas wrote: > On 21 November 2012 13:41, Stefano Lattarini wrote: > >> tags 10227 + moreinfo >> thanks >> >> Hi Roumen, Reuben. >> >> I'm going through old open bugs, and I've noticed this one. Is the >> problem still present, after the recent updates to the python support? >> (They should be already merged in the maint branch by now) If yes, >> could you please provide me with a minimal, clear reproducer, or at >> least restart this discussion from the basics? >> > > I've just checked out the maint branch of automake, and I still see exactly > the same problem: in m4/python.m4 the code used to get the Python package > directory is: > > am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import > sysconfig; > sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" > > Assuming the default am_py_prefix of /usr/local, this gives: > > $ python3 > Python 3.2.3 (default, Oct 19 2012, 19:53:16) > [GCC 4.7.2] on linux2 > Type "help", "copyright", "credits" or "license" for more information. >>>> from distutils import sysconfig; print > (sysconfig.get_python_lib(0,0,'/usr/local')) > /usr/local/lib/python3/dist-packages > > i.e. exactly the same incorrect result as before (the correct answer is: > > /usr/local/lib/python3.2/dist-packages > > on my Ubuntu 12.10 system). I'm sorry, I can't tell whether, as Roumen > suggests, this is an Ubuntu packaging bug, or an automake bug. > OK, thanks for explaining it once again. I can now reproduce the same issue on Debian. I think this is something we should try to work around, since we cannot have our installation rules broken by default on both Debian and Ubuntu ... > It seems to me that this is the sort of thing the pyconfigure people > ought to know about. > By peeking at their repository, I came up with the minimal patch below, which should do the trick. Can you verify it works for you as well? Regards, Stefano ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- >From 30463e31e481537462713cb680279aded6a9d449 Mon Sep 17 00:00:00 2001 Message-Id: <30463e31e481537462713cb680279aded6a9d449.1353588238.git.stefano.lattarini@gmail.com> From: Stefano Lattarini Date: Thu, 22 Nov 2012 12:03:07 +0100 Subject: [PATCH] python: make installed modules find by default on Debian and Ubuntu This change fixes automake bug#10227. The code used to get the python package directory was wrong for Python 3, at least on Debian and Ubuntu distributions. In the case the installation was using the default prefix "/usr/local", python modules were incorrectly installed in the directory /usr/local/lib/python3/dist-packages (which is *not* searched by default), rather than in a directory like /usr/local/lib/python3.x/dist-packages which is searched by default. * m4/python.m4 (AM_PATH_PYTHON): Try to use the 'sysconfig' module if possible, for better interactions with python 3.x. Signed-off-by: Stefano Lattarini --- m4/python.m4 | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/m4/python.m4 b/m4/python.m4 index 50213a9..ab3dfaa 100644 --- a/m4/python.m4 +++ b/m4/python.m4 @@ -106,6 +106,25 @@ AC_DEFUN([AM_PATH_PYTHON], [am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`]) AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform]) + # Just factor out some code duplication. + am_python_setup_sysconfig="\ +import sys +# Prefer sysconfig over distutils.sysconfig, for better compatibility +# with python 3.x. See automake bug#10227. +try: + import sysconfig +except ImportError: + can_use_sysconfig = 0 +else: + can_use_sysconfig = 1 +# Can't use sysconfig in CPython 2.7, since it's broken in virtualenvs: +# +try: + from platform import python_implementation + if python_implementation() == 'CPython' and sys.version[[:3]] == '2.7': + can_use_sysconfig = 0 +except ImportError: + pass" dnl Set up 4 directories: @@ -122,7 +141,14 @@ AC_DEFUN([AM_PATH_PYTHON], else am_py_prefix=$prefix fi - am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null` + am_cv_python_pythondir=`$PYTHON -c " +$am_python_setup_sysconfig +if can_use_sysconfig: + sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) +else: + from distutils import sysconfig + sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') +sys.stdout.write(sitedir)"` case $am_cv_python_pythondir in $am_py_prefix*) am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` @@ -157,7 +183,14 @@ AC_DEFUN([AM_PATH_PYTHON], else am_py_exec_prefix=$exec_prefix fi - am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null` + am_cv_python_pyexecdir=`$PYTHON -c " +$am_python_setup_sysconfig +if can_use_sysconfig: + sitedir = sysconfig.get_path('platlib', vars={'base':'$am_py_prefix'}) +else: + from distutils import sysconfig + sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix') +sys.stdout.write(sitedir)"` case $am_cv_python_pyexecdir in $am_py_exec_prefix*) am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` -- 1.8.0.209.gf3828dc From unknown Sat Jun 21 12:18:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10227: Python installation fails for Python 3 Resent-From: Reuben Thomas Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-automake@gnu.org Resent-Date: Thu, 22 Nov 2012 13:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10227 X-GNU-PR-Package: automake X-GNU-PR-Keywords: To: Stefano Lattarini Cc: 10227@debbugs.gnu.org, Roumen Petrov Received: via spool by 10227-submit@debbugs.gnu.org id=B10227.13535904303655 (code B ref 10227); Thu, 22 Nov 2012 13:21:02 +0000 Received: (at 10227) by debbugs.gnu.org; 22 Nov 2012 13:20:30 +0000 Received: from localhost ([127.0.0.1]:60455 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TbWhi-0000wu-9H for submit@debbugs.gnu.org; Thu, 22 Nov 2012 08:20:30 -0500 Received: from exprod7og108.obsmtp.com ([64.18.2.169]:34553) by debbugs.gnu.org with smtp (Exim 4.72) (envelope-from ) id 1TbWhf-0000wm-Un for 10227@debbugs.gnu.org; Thu, 22 Nov 2012 08:20:29 -0500 Received: from mail-ea0-f200.google.com ([209.85.215.200]) (using TLSv1) by exprod7ob108.postini.com ([64.18.6.12]) with SMTP ID DSNKUK4mSYa78CAP/DckeTammxUf8JxxAB94@postini.com; Thu, 22 Nov 2012 05:19:07 PST Received: by mail-ea0-f200.google.com with SMTP id j13so6157927eaa.3 for <10227@debbugs.gnu.org>; Thu, 22 Nov 2012 05:19:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-gm-message-state; bh=dVXyYBc1ljjnJw1QxpetRQSGY5CmW4jrx+LO4FzIry8=; b=i/oHLCo7RFOZ3dmrGFFfDNeDZpDsB5X6zZOcPXhgMkohBDmy2cL9aBkFndoU2ithNl 5NQYUXPkE0V4v9d1ZO24+BWgQ2t30Gl0gSBEaHFz5IW0z5vvU+NZRFwWnZXSz5Pm52rt 18O7zcReeq83cZdJ3UtnK29XgXylj6g5CH37AhtZ6jCX3o0uQp5pudBi1nbTcRQNhYAy gKchu34jwexrOMeLoRdROpmWN0/u6yoPKPKOUjCZEfgQLznHcJmHLncoiS4FxyWGVLJI 6Br2kH9iJka2umtMLpjIa6rSMjezE/T7oiWNw3TJTl4+wRXvrdlf3wl9N68NJ6Bzg4Tl njXg== Received: by 10.14.194.136 with SMTP id m8mr1617002een.10.1353590345680; Thu, 22 Nov 2012 05:19:05 -0800 (PST) MIME-Version: 1.0 Received: by 10.14.194.136 with SMTP id m8mr1616982een.10.1353590345540; Thu, 22 Nov 2012 05:19:05 -0800 (PST) Received: by 10.14.214.8 with HTTP; Thu, 22 Nov 2012 05:19:05 -0800 (PST) In-Reply-To: <50AE2213.6030906@gmail.com> References: <4EDD50D5.6040400@roumenpetrov.info> <50ACDA0E.9040004@gmail.com> <50AE2213.6030906@gmail.com> Date: Thu, 22 Nov 2012 13:19:05 +0000 Message-ID: From: Reuben Thomas Content-Type: multipart/alternative; boundary=047d7b33dc5cb7a36504cf154fea X-Gm-Message-State: ALoCoQkqKq2DMdnGMjIJaqax4X7jkTnBUEEL81L1n/iqIJGeaEiqAfE7V6EQO0QhacEdaXVWplGg4j5jv/QnGElYYJVatj929PdShLVhsVgQaLs3X58/scYbSrMNxEIcig8P1i2h2y5nCQkc8Vtkb8NA8jDv2HOXpDjkhIyyO4yvTvrBLkQqZe8= X-Spam-Score: -1.5 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.3 (--) --047d7b33dc5cb7a36504cf154fea Content-Type: text/plain; charset=ISO-8859-1 On 22 November 2012 13:01, Stefano Lattarini wrote: > OK, thanks for explaining it once again. I can now reproduce the same > issue on Debian. I think this is something we should try to work around, > since we cannot have our installation rules broken by default on both > Debian and Ubuntu ... > > > It seems to me that this is the sort of thing the pyconfigure people > > ought to know about. > > > By peeking at their repository, I came up with the minimal patch below, > which should do the trick. Can you verify it works for you as well? > It does seem to work for me, but I think it would be worth getting expert advice, e.g. from the pyconfigure developers, as to whether a) this is definitely correct and b) whether it could be simpler. -- http://rrt.sc3d.org --047d7b33dc5cb7a36504cf154fea Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 22 November 2012 13:01, Stefano Lattarini <stefano.lattarini= @gmail.com> wrote:
OK, thanks for explaining it once again. =A0= I can now reproduce the same
issue on Debian. =A0I think this is something we should try to work around,=
since we cannot have our installation rules broken by default on both
Debian and Ubuntu ...

> It seems to me that this is the sort of thing the pyconfigure people > ought to know about.
>
By peeking at their repository, I came up with the minimal patch belo= w,
which should do the trick. =A0Can you verify it works for you as well?
<= /blockquote>

It does seem to work for me, but I think it= would be worth getting expert advice, e.g. from the pyconfigure developers= , as to whether a) this is definitely correct and b) whether it could be si= mpler.

--
http://rrt.sc3d= .org
--047d7b33dc5cb7a36504cf154fea-- From unknown Sat Jun 21 12:18:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10227: Python installation fails for Python 3 Resent-From: Roumen Petrov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-automake@gnu.org Resent-Date: Thu, 22 Nov 2012 22:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10227 X-GNU-PR-Package: automake X-GNU-PR-Keywords: To: 10227@debbugs.gnu.org Cc: Stefano Lattarini , Reuben Thomas Received: via spool by 10227-submit@debbugs.gnu.org id=B10227.135362384627802 (code B ref 10227); Thu, 22 Nov 2012 22:38:02 +0000 Received: (at 10227) by debbugs.gnu.org; 22 Nov 2012 22:37:26 +0000 Received: from localhost ([127.0.0.1]:33635 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TbfOb-0007EI-Nv for submit@debbugs.gnu.org; Thu, 22 Nov 2012 17:37:25 -0500 Received: from rila.superhosting.bg ([91.196.124.212]:53798) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TbfOV-0007E4-Ej for 10227@debbugs.gnu.org; Thu, 22 Nov 2012 17:37:20 -0500 Received: from [78.128.48.21] (port=45804 helo=[192.168.0.10]) by rila.superhosting.bg with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77) (envelope-from ) id 1TbfN8-002ZXe-KO; Fri, 23 Nov 2012 00:35:50 +0200 Message-ID: <50AEA8C6.9070102@roumenpetrov.info> Date: Fri, 23 Nov 2012 00:35:50 +0200 From: Roumen Petrov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121030 Firefox/16.0 SeaMonkey/2.13.2 MIME-Version: 1.0 References: <4EDD50D5.6040400@roumenpetrov.info> <50ACDA0E.9040004@gmail.com> <50AE2213.6030906@gmail.com> In-Reply-To: <50AE2213.6030906@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - rila.superhosting.bg X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roumenpetrov.info X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: 0.8 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.8 (/) Stefano Lattarini wrote: > tags 10227 - moreinfo > thanks > > On 11/21/2012 06:58 PM, Reuben Thomas wrote: >> On 21 November 2012 13:41, Stefano Lattarini wrote: >> >>> tags 10227 + moreinfo >>> thanks >>> >>> Hi Roumen, Reuben. >>> >>> I'm going through old open bugs, and I've noticed this one. Is the >>> problem still present, after the recent updates to the python support? [SNIP] >>> on my Ubuntu 12.10 system). I'm sorry, I can't tell whether, as Roumen >>> suggests, this is an Ubuntu packaging bug, or an automake bug. It seems to me this is a feature as I found this one: http://patch-tracker.debian.org/patch/series/view/python2.6/2.6.6-8/distutils-install-layout.diff > OK, thanks for explaining it once again. I can now reproduce the same > issue on Debian. I think this is something we should try to work around, > since we cannot have our installation rules broken by default on both > Debian and Ubuntu ... Lets say platforms that use the "/posix_local/" installation scheme instead wrong or broken. >> It seems to me that this is the sort of thing the pyconfigure people >> ought to know about. >> > By peeking at their repository, I came up with the minimal patch below, > which should do the trick. Can you verify it works for you as well? > > Regards, > Stefano > > ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- > > From 30463e31e481537462713cb680279aded6a9d449 Mon Sep 17 00:00:00 2001 > Message-Id: <30463e31e481537462713cb680279aded6a9d449.1353588238.git.stefano.lattarini@gmail.com> > From: Stefano Lattarini > Date: Thu, 22 Nov 2012 12:03:07 +0100 > Subject: [PATCH] python: make installed modules find by default on Debian and Ubuntu > > This change fixes automake bug#10227. > > The code used to get the python package directory was wrong for Python 3, > at least on Debian and Ubuntu distributions. In the case the installation > was using the default prefix "/usr/local", python modules were incorrectly > installed in the directory > > /usr/local/lib/python3/dist-packages > > (which is *not* searched by default), rather than in a directory like > > /usr/local/lib/python3.x/dist-packages > > which is searched by default. > > * m4/python.m4 (AM_PATH_PYTHON): Try to use the 'sysconfig' module if > possible, for better interactions with python 3.x. > Signed-off-by: Stefano Lattarini > --- > [SNIP] > > @@ -122,7 +141,14 @@ AC_DEFUN([AM_PATH_PYTHON], > else > am_py_prefix=$prefix > fi > - am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null` > + am_cv_python_pythondir=`$PYTHON -c " > +$am_python_setup_sysconfig > +if can_use_sysconfig: > + sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) > +else: > + from distutils import sysconfig > + sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') > +sys.stdout.write(sitedir)"` Tested with python build from master branch on 2012-11-13 - both paths (sysconfig and distutils.sysconfig based) return same results. > case $am_cv_python_pythondir in > $am_py_prefix*) > am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` > @@ -157,7 +183,14 @@ AC_DEFUN([AM_PATH_PYTHON], > else > am_py_exec_prefix=$exec_prefix > fi > - am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null` > + am_cv_python_pyexecdir=`$PYTHON -c " > +$am_python_setup_sysconfig > +if can_use_sysconfig: > + sitedir = sysconfig.get_path('platlib', vars={'base':'$am_py_prefix'}) Stefano, please use platbase as variable - see Lib/sysconfig.py : .... INSTALL_SCHEMES = { 'posix_prefix': { ... 'purelib': '{base}/lib/python{py_version_short}/site-packages', 'platlib': '{platbase}/lib/python{py_version_short}/site-packages', ... > +else: > + from distutils import sysconfig > + sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix') > +sys.stdout.write(sitedir)"` > case $am_cv_python_pyexecdir in > $am_py_exec_prefix*) > am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` Also I think that python experts should confirm if patch is correct. Roumen From unknown Sat Jun 21 12:18:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10227: Python installation fails for Python 3 Resent-From: Stefano Lattarini Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-automake@gnu.org Resent-Date: Fri, 23 Nov 2012 09:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10227 X-GNU-PR-Package: automake X-GNU-PR-Keywords: To: Roumen Petrov Cc: 10227@debbugs.gnu.org, Reuben Thomas Received: via spool by 10227-submit@debbugs.gnu.org id=B10227.1353662909827 (code B ref 10227); Fri, 23 Nov 2012 09:29:01 +0000 Received: (at 10227) by debbugs.gnu.org; 23 Nov 2012 09:28:29 +0000 Received: from localhost ([127.0.0.1]:34106 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TbpYj-0000DH-01 for submit@debbugs.gnu.org; Fri, 23 Nov 2012 04:28:29 -0500 Received: from mail-bk0-f44.google.com ([209.85.214.44]:64198) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TbpYg-0000D6-1P for 10227@debbugs.gnu.org; Fri, 23 Nov 2012 04:28:28 -0500 Received: by mail-bk0-f44.google.com with SMTP id w11so4044915bku.3 for <10227@debbugs.gnu.org>; Fri, 23 Nov 2012 01:26:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=bxHZ2wMbgKtTeveydsnwZ0nWGE4vzSns6ZTsXhjm5hQ=; b=gRGUx3fZ/lqTyNriETg/CXWYWxAz60OgDGXxAFgly0wSCoBmoCM6Pl75ZCTAf7fr0r OdiuZb2mkqNR1Q/tjg2tg6iHq+9BDJ0xTgM4kk9pKekEH81ih1FdmRp7DxpbxHq9w29+ Hrm6H5xmRj31SdqxJdenUaovtGacSCSCIZM4U5JTC32Xj01SMD8IHCR6iEVog2hIA9I2 566ZqXy+kdSjTu6KSgtwNrdSKn94jrvpiijFSHIsxLNggC006cDekaZ2bJk6dqOm1ppP dwVv+Jtt2Qkzzda5ZdmUwroqz6Z2NJCnmOPavcJyWDduXMq/khttmvOoiWx/d8uwaRv3 s3oQ== Received: by 10.205.130.9 with SMTP id hk9mr1095277bkc.52.1353662817353; Fri, 23 Nov 2012 01:26:57 -0800 (PST) Received: from [192.168.178.21] (host247-100-dynamic.8-87-r.retail.telecomitalia.it. [87.8.100.247]) by mx.google.com with ESMTPS id i20sm3907810bkw.5.2012.11.23.01.26.55 (version=SSLv3 cipher=OTHER); Fri, 23 Nov 2012 01:26:56 -0800 (PST) Message-ID: <50AF415E.8000601@gmail.com> Date: Fri, 23 Nov 2012 10:26:54 +0100 From: Stefano Lattarini MIME-Version: 1.0 References: <4EDD50D5.6040400@roumenpetrov.info> <50ACDA0E.9040004@gmail.com> <50AE2213.6030906@gmail.com> <50AEA8C6.9070102@roumenpetrov.info> In-Reply-To: <50AEA8C6.9070102@roumenpetrov.info> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.1 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 11/22/2012 11:35 PM, Roumen Petrov wrote: > Stefano Lattarini wrote: >> tags 10227 - moreinfo >> thanks >> >> On 11/21/2012 06:58 PM, Reuben Thomas wrote: >>> On 21 November 2012 13:41, Stefano Lattarini wrote: >>> >>>> tags 10227 + moreinfo >>>> thanks >>>> >>>> Hi Roumen, Reuben. >>>> >>>> I'm going through old open bugs, and I've noticed this one. Is the >>>> problem still present, after the recent updates to the python support? > [SNIP] >>>> on my Ubuntu 12.10 system). I'm sorry, I can't tell whether, as Roumen >>>> suggests, this is an Ubuntu packaging bug, or an automake bug. > It seems to me this is a feature as I found this one: > > http://patch-tracker.debian.org/patch/series/view/python2.6/2.6.6-8/distutils-install-layout.diff > The problem didn't lie in the Debian's use of 'dist-packages' instead of 'site-packages' (as you noticed, that was present in python 2.6 already, and Automake still worked nicely); the issue is that, with Python 3 on Debian, the call to distutils.sysconfig.get_python_lib(0,0,prefix='/usr/local') returned: /usr/local/lib/python3/dist-packages that is *not* searched by default by the 'import' statement. >> OK, thanks for explaining it once again. I can now reproduce the same >> issue on Debian. I think this is something we should try to work around, >> since we cannot have our installation rules broken by default on both >> Debian and Ubuntu ... > > Lets say platforms that use the "/posix_local/" installation scheme > instead wrong or broken. > I failed to parse this, sorry. Care to rephrase? >>> It seems to me that this is the sort of thing the pyconfigure people >>> ought to know about. >>> >> By peeking at their repository, I came up with the minimal patch below, >> which should do the trick. Can you verify it works for you as well? >> >> Signed-off-by: Stefano Lattarini >> --- >> [SNIP] >> >> @@ -122,7 +141,14 @@ AC_DEFUN([AM_PATH_PYTHON], >> else >> am_py_prefix=$prefix >> fi >> - am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null` >> + am_cv_python_pythondir=`$PYTHON -c " >> +$am_python_setup_sysconfig >> +if can_use_sysconfig: >> + sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) >> +else: >> + from distutils import sysconfig >> + sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') >> +sys.stdout.write(sitedir)"` > > Tested with python build from master branch on 2012-11-13 - both paths > (sysconfig and distutils.sysconfig based) return same results. > Thanks for pointing that out. I've given the code a try with a python 3.2 installed from sources, and I can confirm this happens for me as well. So no regression for that kind of setup, at least. On the other hand, for a python 3.2 installed from Debian packages, the results are different: # Code with distutils.sysconfig ${prefix}/lib/python3/dist-packages # Code with sysconfig ${prefix}/lib/python3.2/site-packages The second result is the correct one; in fact, the 'dist-packages' directory is meant as the location of python modules installed from Debian packages (reference: ), so we shouldn't need to install into such a directory; and when ${prefix} is /usr/local, the "${prefix}/lib/python3.2/site-packages" directory is searched by default by the 'import' statement. At this point, I'm convinced my patch is quite correct. >> case $am_cv_python_pythondir in >> $am_py_prefix*) >> am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` >> @@ -157,7 +183,14 @@ AC_DEFUN([AM_PATH_PYTHON], >> else >> am_py_exec_prefix=$exec_prefix >> fi >> - am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null` >> + am_cv_python_pyexecdir=`$PYTHON -c " >> +$am_python_setup_sysconfig >> +if can_use_sysconfig: >> + sitedir = sysconfig.get_path('platlib', vars={'base':'$am_py_prefix'}) > > Stefano, please use platbase as variable - see Lib/sysconfig.py: > .... > INSTALL_SCHEMES = { > 'posix_prefix': { > ... > 'purelib': '{base}/lib/python{py_version_short}/site-packages', > 'platlib': '{platbase}/lib/python{py_version_short}/site-packages', > ... > Good catch! I will fix this. >> +else: >> + from distutils import sysconfig >> + sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix') >> +sys.stdout.write(sitedir)"` >> case $am_cv_python_pyexecdir in >> $am_py_exec_prefix*) >> am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` > > Also I think that python experts should confirm if patch is correct. > I'd love that. Feel free to ping any GNU python expert about giving a look at this patch. Thanks, Stefano From unknown Sat Jun 21 12:18:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10227: Python installation fails for Python 3 Resent-From: Stefano Lattarini Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-automake@gnu.org Resent-Date: Mon, 26 Nov 2012 12:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10227 X-GNU-PR-Package: automake X-GNU-PR-Keywords: To: Roumen Petrov Cc: 10227@debbugs.gnu.org, Reuben Thomas Received: via spool by 10227-submit@debbugs.gnu.org id=B10227.135393134128426 (code B ref 10227); Mon, 26 Nov 2012 12:03:02 +0000 Received: (at 10227) by debbugs.gnu.org; 26 Nov 2012 12:02:21 +0000 Received: from localhost ([127.0.0.1]:39341 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TcxOG-0007OQ-6E for submit@debbugs.gnu.org; Mon, 26 Nov 2012 07:02:21 -0500 Received: from mail-la0-f44.google.com ([209.85.215.44]:63415) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TcxOC-0007OH-Ij for 10227@debbugs.gnu.org; Mon, 26 Nov 2012 07:02:18 -0500 Received: by mail-la0-f44.google.com with SMTP id d3so9309313lah.3 for <10227@debbugs.gnu.org>; Mon, 26 Nov 2012 04:00:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=F29+PfuujpXIovPRo7EN/iwIlH/e6LqdEmy+hv6FE8c=; b=BC0WdzH0efOep6ZUxChZT4I6tIcvXYGk2H0rUVjNpBQk8p/gA7YE1p3cFb9rGRgSNV G9fcpocyhvTbVKC8WY9CfvxIsSVOQt+ZySUp4Xqe5/iRVD//uTH9Hq7p+1yOSjTa7qDq 1KWQie6tfK+G27D9H0jYzLbgENoaXREejLWRfLlt/qQ7QxF9Ujw2w9thW29LwGHvHOuA EdWMqNIbWVOr4VdiqHAslPYfNEN/KaQ5MC2FC38/QH5zaWy+5LNQNpzhl2Slx/+l9Fsn nRJN3Q3x/0XP8+aAxMJb6Azjve39qYQA1m13/XIkI/IAtZnAO7Dkc0WM3bkV+Nrtt05l DJhg== Received: by 10.112.100.195 with SMTP id fa3mr1159959lbb.38.1353931232692; Mon, 26 Nov 2012 04:00:32 -0800 (PST) Received: from [192.168.178.21] (host54-50-dynamic.58-82-r.retail.telecomitalia.it. [82.58.50.54]) by mx.google.com with ESMTPS id oj5sm5297332lab.8.2012.11.26.04.00.30 (version=SSLv3 cipher=OTHER); Mon, 26 Nov 2012 04:00:31 -0800 (PST) Message-ID: <50B359DC.8040607@gmail.com> Date: Mon, 26 Nov 2012 13:00:28 +0100 From: Stefano Lattarini MIME-Version: 1.0 References: <4EDD50D5.6040400@roumenpetrov.info> <50ACDA0E.9040004@gmail.com> <50AE2213.6030906@gmail.com> <50AEA8C6.9070102@roumenpetrov.info> <50AF415E.8000601@gmail.com> In-Reply-To: <50AF415E.8000601@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) tags 10227 + patch close 10227 thanks On 11/23/2012 10:26 AM, Stefano Lattarini wrote: > On 11/22/2012 11:35 PM, Roumen Petrov wrote: >> Stefano Lattarini wrote: >>> tags 10227 - moreinfo >>> thanks >>> >>> On 11/21/2012 06:58 PM, Reuben Thomas wrote: >>>> On 21 November 2012 13:41, Stefano Lattarini wrote: >>>> >>>>> tags 10227 + moreinfo >>>>> thanks >>>>> >>>>> Hi Roumen, Reuben. >>>>> >>>>> I'm going through old open bugs, and I've noticed this one. Is the >>>>> problem still present, after the recent updates to the python support? >> [SNIP] >>>>> on my Ubuntu 12.10 system). I'm sorry, I can't tell whether, as Roumen >>>>> suggests, this is an Ubuntu packaging bug, or an automake bug. >> It seems to me this is a feature as I found this one: >> >> http://patch-tracker.debian.org/patch/series/view/python2.6/2.6.6-8/distutils-install-layout.diff >> > The problem didn't lie in the Debian's use of 'dist-packages' instead > of 'site-packages' (as you noticed, that was present in python 2.6 > already, and Automake still worked nicely); the issue is that, with > Python 3 on Debian, the call to > > distutils.sysconfig.get_python_lib(0,0,prefix='/usr/local') > > returned: > > /usr/local/lib/python3/dist-packages > > that is *not* searched by default by the 'import' statement. > >>> OK, thanks for explaining it once again. I can now reproduce the same >>> issue on Debian. I think this is something we should try to work around, >>> since we cannot have our installation rules broken by default on both >>> Debian and Ubuntu ... >> >> Lets say platforms that use the "/posix_local/" installation scheme >> instead wrong or broken. >> > I failed to parse this, sorry. Care to rephrase? > >>>> It seems to me that this is the sort of thing the pyconfigure people >>>> ought to know about. >>>> >>> By peeking at their repository, I came up with the minimal patch below, >>> which should do the trick. Can you verify it works for you as well? >>> > >>> Signed-off-by: Stefano Lattarini >>> --- >>> [SNIP] >>> >>> @@ -122,7 +141,14 @@ AC_DEFUN([AM_PATH_PYTHON], >>> else >>> am_py_prefix=$prefix >>> fi >>> - am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null` >>> + am_cv_python_pythondir=`$PYTHON -c " >>> +$am_python_setup_sysconfig >>> +if can_use_sysconfig: >>> + sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) >>> +else: >>> + from distutils import sysconfig >>> + sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') >>> +sys.stdout.write(sitedir)"` >> >> Tested with python build from master branch on 2012-11-13 - both paths >> (sysconfig and distutils.sysconfig based) return same results. >> > Thanks for pointing that out. I've given the code a try with a python 3.2 > installed from sources, and I can confirm this happens for me as well. So > no regression for that kind of setup, at least. > > On the other hand, for a python 3.2 installed from Debian packages, the > results are different: > > # Code with distutils.sysconfig > ${prefix}/lib/python3/dist-packages > > # Code with sysconfig > ${prefix}/lib/python3.2/site-packages > > The second result is the correct one; in fact, the 'dist-packages' > directory is meant as the location of python modules installed from > Debian packages (reference: ), so we > shouldn't need to install into such a directory; and when ${prefix} > is /usr/local, the "${prefix}/lib/python3.2/site-packages" directory > is searched by default by the 'import' statement. > > At this point, I'm convinced my patch is quite correct. > >>> case $am_cv_python_pythondir in >>> $am_py_prefix*) >>> am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` >>> @@ -157,7 +183,14 @@ AC_DEFUN([AM_PATH_PYTHON], >>> else >>> am_py_exec_prefix=$exec_prefix >>> fi >>> - am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null` >>> + am_cv_python_pyexecdir=`$PYTHON -c " >>> +$am_python_setup_sysconfig >>> +if can_use_sysconfig: >>> + sitedir = sysconfig.get_path('platlib', vars={'base':'$am_py_prefix'}) >> >> Stefano, please use platbase as variable - see Lib/sysconfig.py: >> .... >> INSTALL_SCHEMES = { >> 'posix_prefix': { >> ... >> 'purelib': '{base}/lib/python{py_version_short}/site-packages', >> 'platlib': '{platbase}/lib/python{py_version_short}/site-packages', >> ... >> > Good catch! I will fix this. > >>> +else: >>> + from distutils import sysconfig >>> + sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix') >>> +sys.stdout.write(sitedir)"` >>> case $am_cv_python_pyexecdir in >>> $am_py_exec_prefix*) >>> am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` >> >> Also I think that python experts should confirm if patch is correct. >> > I'd love that. Feel free to ping any GNU python expert about giving > a look at this patch. > I've pushed this patch, since it seems quite correct to me (and I think we have correctly understood the underlying issue). I'm ready to revisit this change if anyone complains. I'm marking this issue as "done". Thanks, Stefano From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 26 07:02:53 2012 Received: (at control) by debbugs.gnu.org; 26 Nov 2012 12:02:53 +0000 Received: from localhost ([127.0.0.1]:39344 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TcxOm-0007P7-Kr for submit@debbugs.gnu.org; Mon, 26 Nov 2012 07:02:53 -0500 Received: from mail-la0-f44.google.com ([209.85.215.44]:51171) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TcxOl-0007Oz-6j for control@debbugs.gnu.org; Mon, 26 Nov 2012 07:02:51 -0500 Received: by mail-la0-f44.google.com with SMTP id d3so9309822lah.3 for ; Mon, 26 Nov 2012 04:01:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=Hif69iT6imLjSXKjQJJpT1zNHIlgiS9Drm60cAV/kt4=; b=hKBSqXpwB+3LMAHk0rQShN2B+YWbrikIQW1l0S6sym2uP8LWIMSOVRMeveruspBr8v L00+6UsRY99JNiRW+Do01iPxJ/KjBpGH5JjRacL5Rx2kdXe2CoQsRiy+z4S5ik/2jj1i aFkSN4DcmPWvB9K+0zpuHNkIzGY+TCvstdNB1yaOeju8W/y2WgcmqmR0yOmV2/aYF4qj 8M0me6dic27Yb5oxzwar7/u7QT4ysKBAeAUJRt4Qhj1Y7NpDj0jjgSRqluBqaiVwg6jd 1b4n+y39NMgL+EokCaFJQjv9SxE1Bg3XbyBBpJY9NHZamVlWF4F+CyPfLetzR6AyCupH mYBA== Received: by 10.112.29.229 with SMTP id n5mr5131254lbh.130.1353931267775; Mon, 26 Nov 2012 04:01:07 -0800 (PST) Received: from [192.168.178.21] (host54-50-dynamic.58-82-r.retail.telecomitalia.it. [82.58.50.54]) by mx.google.com with ESMTPS id p9sm5549412lbc.3.2012.11.26.04.01.06 (version=SSLv3 cipher=OTHER); Mon, 26 Nov 2012 04:01:06 -0800 (PST) Message-ID: <50B35A00.2060002@gmail.com> Date: Mon, 26 Nov 2012 13:01:04 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: GNU bug tracker automated control server Subject: Re: bug#10227: Python installation fails for Python 3 References: <4EDD50D5.6040400@roumenpetrov.info> <50ACDA0E.9040004@gmail.com> <50AE2213.6030906@gmail.com> <50AEA8C6.9070102@roumenpetrov.info> <50AF415E.8000601@gmail.com> In-Reply-To: <50AF415E.8000601@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.1 (/) tags 10227 + patch close 10227 thanks