From owner-freebsd-python@freebsd.org Mon Jan 4 23:01:42 2016 Return-Path: Delivered-To: freebsd-python@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDBCFA6206F for ; Mon, 4 Jan 2016 23:01:42 +0000 (UTC) (envelope-from duchateau.olivier@gmail.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id B20631097 for ; Mon, 4 Jan 2016 23:01:42 +0000 (UTC) (envelope-from duchateau.olivier@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id B1BC0A6206E; Mon, 4 Jan 2016 23:01:42 +0000 (UTC) Delivered-To: python@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9787EA6206D for ; Mon, 4 Jan 2016 23:01:42 +0000 (UTC) (envelope-from duchateau.olivier@gmail.com) Received: from mail-wm0-x231.google.com (mail-wm0-x231.google.com [IPv6:2a00:1450:400c:c09::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 34A551095 for ; Mon, 4 Jan 2016 23:01:42 +0000 (UTC) (envelope-from duchateau.olivier@gmail.com) Received: by mail-wm0-x231.google.com with SMTP id f206so3451823wmf.0 for ; Mon, 04 Jan 2016 15:01:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=2GKjKxJnbyLQhEWdqWpb0EGCUffRZoQ7989qe7KzGfk=; b=EL6a4NKLB5a3ds8tzX55lK90QYlmpyovj7l4pnpR7d6M0fdhkD4hzNhFDvQ/g3uLV4 t8mvjLIx8PbTMbIkaHs2pVdz59JA3Qmn9GVPsveW4pjLuq3SVfBCbWCtcx1MWlxK09ig +zRUDd5WiK1mA0Xwofao619I+tzwMDUZS7rBq6qXP36HJ82xSFE3XE1Nr0y63yrGUOeC 7xJYGD/nX0mX2w1i2LcTfCirfCJIHWxLUf1LNhzMhKr6WzLESK77K2pI8oACA3HOm6zO dWWhPYgdYcsIalwJZWFM8QpKXajS8Q/lAWuh2HF+lXKXrXLbPRDBoDa26Jlq9p4t4vxx dA2g== X-Received: by 10.28.194.69 with SMTP id s66mr798790wmf.93.1451948500756; Mon, 04 Jan 2016 15:01:40 -0800 (PST) Received: from tuborg (AMarseille-655-1-753-75.w92-150.abo.wanadoo.fr. [92.150.162.75]) by smtp.gmail.com with ESMTPSA id u12sm680030wmu.10.2016.01.04.15.01.39 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 04 Jan 2016 15:01:39 -0800 (PST) Date: Mon, 4 Jan 2016 23:59:13 +0000 From: Olivier Duchateau To: "Mikhail T." Cc: python@FreeBSD.org Subject: Re: SOLVED: numpy would not load: libgcc_s vs. libgfortran Message-Id: <20160104235913.13cbed5baa5b33b3bdef375f@gmail.com> In-Reply-To: <568AEB8C.2000805@aldan.algebra.com> References: <568AA168.5090400@aldan.algebra.com> <20160104193453.2ae62e7a01ab0a0cd845e296@gmail.com> <568AC046.8040300@aldan.algebra.com> <20160104213150.4e47df03583e70cef356a51d@gmail.com> <568AE454.6010604@aldan.algebra.com> <568AEB8C.2000805@aldan.algebra.com> X-Mailer: Sylpheed 3.4.3 (GTK+ 2.24.28; i386-portbld-freebsd9.3) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 23:01:43 -0000 On Mon, 04 Jan 2016 17:00:44 -0500 "Mikhail T." wrote: > On 04.01.2016 16:29, Mikhail T. wrote: > > ImportError: > > /opt/lib/python2.7/site-packages/numpy/core/multiarray.so: Undefined > > symbol "cblas_cdotc_sub" > Ok, the above went away, when I rebuilt all of the Fortran-using > dependencies of numpy with gfortran5. Don't know, if they were built > incorrectly somehow, or if something is wrong with gfortran48. > > My one-liner test script now "works", but the original problem is still > here -- only now it complains about gcc5's libgfortran: > > File "/opt/lib/python2.7/site-packages/numpy/core/__init__.py", > line 14, in > from . import multiarray > ImportError: /lib/libgcc_s.so.1: version GCC_4.6.0 required by > /opt/lib/gcc5/libgfortran.so.3 not found > > I wonder, if this has something to do with my setting PYTHONPATH -- I > need the not-yet-installed mediagoblin packages to be found in ${WRKSRC} > by the tests. What is the proper way of to do this? You can add module (and submodules) with sys module. For example in mediagoblin/tests/tools.py before line beginning by 'from mediagoblin ...' import sys # Full path of mediagoblin sys.append('/spare/usr/ports/www/py-mediagoblin/work/mediagoblin-0.8.1/mediagoblin') You need also add subdirectories (that's why it's not easy to debug, because some directories is not necessarily Python's module, no __init__.py file). Another way is to use os.walk() function: import os import sys # mediagoblin full path goblin_path = '/spare/usr/ports/www/py-mediagoblin/work/mediagoblin-0.8.1/mediagoblin' for root, dirs, files in os.walk(goblin_path): for name in dirs: sys.append(os.path.join(root, name)) > > Thank you! > > -mi > -- olivier