From owner-freebsd-python@FreeBSD.ORG Tue Feb 11 08:25:08 2014 Return-Path: Delivered-To: python@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 ESMTPS id 78C2E6C0 for ; Tue, 11 Feb 2014 08:25:08 +0000 (UTC) Received: from mail-pb0-x235.google.com (mail-pb0-x235.google.com [IPv6:2607:f8b0:400e:c01::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 46A021668 for ; Tue, 11 Feb 2014 08:25:08 +0000 (UTC) Received: by mail-pb0-f53.google.com with SMTP id md12so7352498pbc.26 for ; Tue, 11 Feb 2014 00:25:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:reply-to:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=5BDg5z3AfAzxgIuFQht7bUyMTOroJssTKF+IMjXiNcY=; b=TWDl4FGSj3lpopdIs/HZVINu3+I7DtSIxlVs9zgzsDkayVxqIxIroMcnc7Ama6Q9Tl FsT8T/BbkWQGWJDYlsV1BZ2oYf8EOxrjlqi7L93cTPevdE6gIhbuyX/pDo1zyDVsJL15 imNj5dsuRFI8rbkUBP7dF4VKDN8Oz6ecznRI50A1os+pcPpsQ5ejI4EM1K6wzZ6EeWPZ 3GWUyYtyz6TCj32KNa3lw4I/uCoZHd/312pGQ6ycGyQ0R8CRlK+FuJFS99TJneqC8i+y pK3fySX9DK4ZsyHhfktCLh5s41KDLQ9GtXIuCY7grBJVOhqAe3reszYR8bsYyc8d9s/l D9wQ== X-Received: by 10.68.194.97 with SMTP id hv1mr8782032pbc.162.1392107106650; Tue, 11 Feb 2014 00:25:06 -0800 (PST) Received: from [192.168.1.7] (ppp59-167-128-11.static.internode.on.net. [59.167.128.11]) by mx.google.com with ESMTPSA id sy10sm130751758pac.15.2014.02.11.00.25.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Feb 2014 00:25:05 -0800 (PST) Message-ID: <52F9DE5D.1050407@FreeBSD.org> Date: Tue, 11 Feb 2014 19:25:01 +1100 From: Kubilay Kocak User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Thunderbird/27.0 MIME-Version: 1.0 To: Scott Sturdivant Subject: Re: python27-2.7.6_2 doesn't have pkg_resources? References: <52F943B6.2080705@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: python X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: koobs@FreeBSD.org List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Feb 2014 08:25:08 -0000 On 11/02/2014 9:35 AM, Scott Sturdivant wrote: > Hi Kubilay, > > It looks like the FreeBSD 9.2 repo has py27-virtualenv 1.10.1 as the > latest. I've got a poudriere machine that has built 1.11.2. > > When installing virtualenv 1.11.2, I'm not getting the dependency on > py27-setuptools and as such it lets me install py27-virtualenv 1.11.2, then > errors out when trying to create a virtualenv. > > Looking at this commit ( > https://github.com/freebsd/freebsd-ports/commit/cdcc5f4edbe977fdcab31bd9f52ed18067bc9a57), > is it possible that the removal of SETUPTOOLSVER means that it's no longer > a run dependency? Sorry, I don't know enough about the macro magic... > > Thanks, > > Scott > > > On Mon, Feb 10, 2014 at 2:25 PM, Kubilay Kocak wrote: > >> On 11/02/2014 7:48 AM, Scott Sturdivant wrote: >>> Thanks William, that indeed does appear to be the issue. Sorry for the >>> noise, and thanks again for the pointer to the right direction! >>> >>> >>> On Mon, Feb 10, 2014 at 1:43 PM, William Grzybowski >> wrote: >>> >>>> >>>> On Mon, Feb 10, 2014 at 6:07 PM, Scott Sturdivant < >>>> scott.sturdivant@gmail.com> wrote: >>>> >>>>> Hi, >>>>> >>>>> With the latest FreeBSD package (2.7.6_2), the pkg_resource module >> seems >>>>> to >>>>> be broken: >>>>> >>>>> # pkg info | grep python27 >>>>> python27-2.7.6_2 Interpreted object-oriented programming >>>>> language >>>>> # /usr/local/bin/python2.7 -c 'import pkg_resources' >>>>> Traceback (most recent call last): >>>>> File "", line 1, in >>>>> ImportError: No module named pkg_resources >>>>> >>>>> >>>>> This was not the case on 2.7.6_1: >>>>> >>>>> # pkg info | grep python27 >>>>> python27-2.7.6_1 Interpreted object-oriented programming >>>>> language >>>>> # /usr/local/bin/python2.7 -c 'import pkg_resources' >>>>> # >>>>> >>>>> >>>>> This impact other packages such as py27-virtualenv. If i try to >> create a >>>>> virtualenv, it immediately aborts with the error that pkg_resources >>>>> doesn't >>>>> exist. >>>>> >>>>> Am I doing something wrong? >>>>> >>>> >>>> AFAIK pkg_resources comes from devel/py-setuptools, not from >>>> lang/python2.7 . >>>> It sounds like devel/py-virtualenv is broken and should have an explicit >>>> run dependency for devel/py-setuptools. >>>> >>>> >>>> >>>> -- >>>> William Grzybowski >>>> ------------------------------------------ >>>> Curitiba/PR - Brasil >>>> >>> _______________________________________________ >>> freebsd-python@freebsd.org mailing list >>> http://lists.freebsd.org/mailman/listinfo/freebsd-python >>> To unsubscribe, send any mail to "freebsd-python-unsubscribe@freebsd.org >> " >>> >> >> Hi Scott, >> >> I updated the pip, virtualenv and virtualenvwrapper ports yesterday to >> their respective latest upstream versions. I'm not sure if you're >> reporting your issue after updating, but if you haven't already >> upgraded, try the latest. >> >> Note: The previous to current version delta is pretty big, and there are >> a number of backwards incompatible changes in at least virtualenv and >> pip. Read the Changes URL's that were included in the commit message for >> each. >> >> Let me know if you come across anything in the port updates that I may >> have overlooked. If you find an upstream commit for the issue, I'll back >> port it. >> >> -- >> koobs >> > A few things to add: py-virtualenv has an implicit setuptools build time dependency (BUILD_DEPENDS) set because the port uses USE_PYDISTUTILS=yes which does: ------------ .if defined(USE_PYDISTUTILS) && ${_CURRENTPORT} != ${PYTHON_PKGNAMEPREFIX}setuptools BUILD_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}setuptools>0:${PORTSDIR}/devel/py-setuptools ------------ The same is not set for setuptools as a *run* time dependency (RUN_DEPENDS), BUT .. The last commit replaced USE_PYDISTUTILS=easy_install with USE_PYDISTUTILS=yes. The previous value of =easy_install does this: ------------ .if defined(USE_PYDISTUTILS) && ${USE_PYDISTUTILS} == "easy_install" RUN_DEPENDS+= ${PYEASYINSTALL_CMD}:${PORTSDIR}/devel/py-setuptools ------------ To test, I installed the latest virtualenv via ports (not the package), and tested virtualenv creation: `virtualenv test` New python executable in test/bin/python2.7 Also creating executable in test/bin/python Installing setuptools, pip...done. I then remove py-setuptools, which exists because I use ports and dont remove build dependencies, and I see your issue: ------------ Traceback (most recent call last): File "/usr/local/bin/virtualenv", line 5, in from pkg_resources import load_entry_point ImportError: No module named pkg_resources ------------ I think this issue extends to all Python modules with console scripts that are installed via packages. I can reproduce the same results with py-nose (`nosetests`) and py-tox (`tox`): ------------ Traceback (most recent call last): File "/usr/local/bin/nosetests", line 5, in from pkg_resources import load_entry_point ImportError: No module named pkg_resources Traceback (most recent call last): File "/usr/local/bin/tox", line 5, in from pkg_resources import load_entry_point ImportError: No module named pkg_resources ------------ I'll sort out a permanent resolution shortly. In the meantime, install the setuptools package to compensate and please confirm that this resolves the issue for you. -- koobs