From owner-freebsd-ports@FreeBSD.ORG Mon Jul 29 10:22:35 2013 Return-Path: Delivered-To: ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2A11040E; Mon, 29 Jul 2013 10:22:35 +0000 (UTC) (envelope-from demelier.david@gmail.com) Received: from mail-wg0-x22b.google.com (mail-wg0-x22b.google.com [IPv6:2a00:1450:400c:c00::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 906842BBA; Mon, 29 Jul 2013 10:22:34 +0000 (UTC) Received: by mail-wg0-f43.google.com with SMTP id z12so4764782wgg.22 for ; Mon, 29 Jul 2013 03:22:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=iqgszWAXkhC3G3cECny4j1og0WKwj0g6Af2EDukN76Q=; b=OyvKx9LR+N7j/UkAxTquK+aVv7dNhyddpEvuRNRZbILjmuHBTI6IXcCgvrxIxmnj1D HyJfJKjZuJlvWYMRJlbVu7C6ulWQzmoZB1XNKhV+zWEn8Ys4HT7rnwfVed1+XKcUrKjZ yrNR2O1GiKY6Ll1K253H8Ilrj3h15aFiTORCKYxC5/bSFvzHbFxfVndCVW8f0q2M2URW +BiGMKlIUhfaXMoNQdr7x5Zd/SbQFtBMWAd7hsb0urqXGZg2t4Xrheo8YaOVcr4cUMW0 xhRkT+/gOvN4RBs8zYHVMVrQt2W6FHsMpKYFa82ZmM8Th45Y5doqor/EGEECwq1LyVB9 Ku0A== MIME-Version: 1.0 X-Received: by 10.180.98.233 with SMTP id el9mr6570214wib.54.1375093352754; Mon, 29 Jul 2013 03:22:32 -0700 (PDT) Received: by 10.194.239.164 with HTTP; Mon, 29 Jul 2013 03:22:32 -0700 (PDT) In-Reply-To: <20130729110145.Horde.vaUlaCnJ-q1VD1He43pO6Q8@webmail.df.eu> References: <20130729110145.Horde.vaUlaCnJ-q1VD1He43pO6Q8@webmail.df.eu> Date: Mon, 29 Jul 2013 12:22:32 +0200 Message-ID: Subject: Re: python 2 and 3 modules From: David Demelier To: mva@freebsd.org Content-Type: text/plain; charset=UTF-8 Cc: ports@freebsd.org X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 10:22:35 -0000 2013/7/29 Marcus von Appen : > David Demelier : > > >> 2013/7/28 Daniel Braniss : >>> >>> Hi, >>> I need to be able to have both (2.7 and 3.2) modules. >>> setting PYTHON_VERSION=3.2 in /etc/make.conf compiles properly, >>> but make install, insists that that the 2.7 version is installed! >>> after deinstalling, it will install the 3.2 version in the correct >>> directory: >>> /usr/local/lib/python3.2/site-path >>> but now I lost the 2.7 version. >>> >>> the same happens if I try to install the 2.7 version, it will complain >>> that the 3,2 version is installed. >>> >>> BTW, the comments in ports/Mk/bsd.python.mk are very confusing and >>> some are wrong: >>> # PYTHON_VERSION - Version of the python binary in your ${PATH}, >>> in the >>> # format "python2.0". Set this in >>> your >>> makefile in case you >>> # want to build extensions with >>> an >>> older binary. >>> # default: depends on the version >>> of >>> your python binary >>> >>> setting it to "python3.2" produces errors in the make, while 3.2 is ok >>> >>> is there any fix? >>> >>> thanks, >>> danny >>> >> >> For the moment its pretty difficult to install python 2.7 and 3.3 at >> the same time. However, if you plan to install python 3.3, you need to >> set PYTHON_DEFAULT_VERSION to "python3.3" and not PYTHON_VERSION. > > > No, it is not. > > cd /usr/ports/lang/python27 && make install clean > cd /usr/ports/lang/python32 && make install clean > cd /usr/ports/lang/python33 && make install clean > > works like a charm. If you however want to use Python modules, it might > become > more difficult. It was discussed some time ago on the freebsd-python mailing > list > without an applicable result. > > If you need to have the same Python module for different versions around, I > would > recommend to use virtualenv in favour of the ports infrastructure, since > > make -DPYTHON_DEFAULT_VERSION=xxx - or - > make -DPYTHON_VERSION=xxx - or - > make -DPYTHON3_DEFAULT_VERSION=xxx > > might mess up previous installations for a different python version. > > Cheers > Marcus > Of course from ports it will work. I've told about binary packages. When you bulk build a package for python 2.7 and python 3.3 the /usr/local/bin/python will be included in both versions. Because bulk building python 3 modules will requires to set PYTHON_DEFAULT_VERSION and PYTHON3_DEFAULT_VERSION to the python 3.3 interpreter. Then the poudriere bulk will generate python 2.7 and python 3.3 pkg-plist including for both /usr/local/bin/python and all of the non-versioned files I've already told above. You may now think "who cares? it build from ports". I would say no, binary packages will be used more and more in the future. If we install the /usr/local/bin/python symlink by testing its presence instead of the default version the problem will be fixed. Regards, -- Demelier David