From owner-freebsd-ports@FreeBSD.ORG Mon Jul 29 09:10:40 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 DB0BA228 for ; Mon, 29 Jul 2013 09:10:40 +0000 (UTC) (envelope-from mva@freebsd.org) Received: from smtprelay05.ispgateway.de (smtprelay05.ispgateway.de [80.67.31.99]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9B2C92877 for ; Mon, 29 Jul 2013 09:10:40 +0000 (UTC) Received: from [80.67.16.112] (helo=webmailfront02.ispgateway.de) by smtprelay05.ispgateway.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1V3jKr-0002qL-70 for ports@freebsd.org; Mon, 29 Jul 2013 11:01:45 +0200 Received: from his1.his.de (his1.his.de [192.124.237.237]) by webmail.df.eu (Horde Framework) with HTTP; Mon, 29 Jul 2013 11:01:45 +0200 Date: Mon, 29 Jul 2013 11:01:45 +0200 Message-ID: <20130729110145.Horde.vaUlaCnJ-q1VD1He43pO6Q8@webmail.df.eu> From: Marcus von Appen To: ports@freebsd.org Subject: Re: python 2 and 3 modules References: In-Reply-To: User-Agent: Internet Messaging Program (IMP) H5 (6.0.4) Content-Type: text/plain; charset=UTF-8; format=flowed; DelSp=Yes MIME-Version: 1.0 Content-Disposition: inline X-Df-Sender: ZnJlZWJzZEBzeXNmYXVsdC5vcmc= X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: mva@freebsd.org List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 09:10:40 -0000 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