From owner-freebsd-python@freebsd.org Thu Feb 1 15:11:31 2018 Return-Path: Delivered-To: freebsd-python@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07E42ED6CBC for ; Thu, 1 Feb 2018 15:11:31 +0000 (UTC) (envelope-from rsmith@xs4all.nl) Received: from lb1-smtp-cloud7.xs4all.net (lb1-smtp-cloud7.xs4all.net [194.109.24.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.xs4all.net", Issuer "RapidSSL SHA256 CA - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 87649707B7 for ; Thu, 1 Feb 2018 15:11:30 +0000 (UTC) (envelope-from rsmith@xs4all.nl) Received: from slackbox.erewhon.home ([83.162.243.5]) by smtp-cloud7.xs4all.net with ESMTPA id hGVJeSDap3A62hGVLeR77J; Thu, 01 Feb 2018 16:10:23 +0100 Received: from rsmith (uid 1001) (envelope-from rsmith@xs4all.nl) id 12312 by slackbox.erewhon.home (DragonFly Mail Agent v0.11+); Thu, 01 Feb 2018 16:10:21 +0100 Date: Thu, 1 Feb 2018 16:10:21 +0100 From: Roland Smith To: Gerhard Schmidt Cc: FreeBSD Python Subject: Re: Installing a port to a specific python version Message-ID: <20180201151021.GA52705@slackbox.erewhon.home> Mail-Followup-To: Gerhard Schmidt , FreeBSD Python References: <6825a87e-60ec-f3bd-3368-2a6a519667bb@ze.tum.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6825a87e-60ec-f3bd-3368-2a6a519667bb@ze.tum.de> User-Agent: Mutt/1.9.2 (2017-12-15) X-CMAE-Envelope: MS4wfKbBwQQAdNh7IOQ/aGwDrx6Jy39td2ZqZSS2zgrNU1wG9W+kBJtNgOkizG/xoOtV7IFlrvE7aklZ+aMz/7iYhm5lA7NclIqclpbwHJ0XiUmDMqhsyHy8 7A5Pa31SMnFxC5/WgMiYAwrC1qn11lyrbe13iqbCR6abNxzrI6L1icgecV9tBozgGheeUafP7z2rFg== X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Feb 2018 15:11:31 -0000 On Wed, Jan 31, 2018 at 08:00:55AM +0100, Gerhard Schmidt wrote: > Hi > > I'm having a small problem with python and FreeBSD. I'm a python > developer. I Maintain some legacy code written in python2.7 and some new > projects in Python 3.6 and for testing purposes i need python 3.4 and > 3.5. So I need all this versions of python on my system, at least to be > able to create virtual envs. > > Installing the python interpreters is not a problem, but installing > python packages. > > How can in say a port it shouldn't use the default version stated in > make.conf but a specific version. I don't want to change the default > version every time i install a Port. > > I've tried to set PYTHON_VERSION as environment variable. > I've tried to give PYTHON_VERSION as parameter to make. > I've tried to give PYTHON as parameter to make. > I've tried python3.5 python35 3.5 and 35 with each of them, it still > installed the default python version. > > Then i tried make PYTHON_DEFAULT=3.5 and get a error message. Python ports work with "flavors" now. See the entries for 20171130 in /usr/ports/UPDATING. Use it like this:: cd /usr/ports/ make FLAVOR=py36 install clean If you always want a specific version of a port, you can put the following in /etc/make.conf:: .if ${.CURDIR:M*/devel/ipython} FLAVOR=py36 .endif If you always want to build ports for all supported versions of Python, use the following in /etc/make.conf:: BUILD_ALL_PYTHON_FLAVORS=true You *might* be able to restrict that to a specific package, like this:: .if ${.CURDIR:M*/www/py-requests} BUILD_ALL_PYTHON_FLAVORS=true .endif According to the docs, `pkg` supports flavors. But I can't find anything in the manpage. Hope this helps, Roland -- R.F.Smith http://rsmith.home.xs4all.nl/ [plain text email much appreciated]