From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: Re: PYTHONPATH woes Date: Thu, 22 Feb 2018 16:30:04 +0100 Message-ID: <87371tqbyb.fsf@elephly.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45087) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eot44-0008Ea-10 for guix-devel@gnu.org; Thu, 22 Feb 2018 10:45:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eot3z-00080X-W6 for guix-devel@gnu.org; Thu, 22 Feb 2018 10:45:44 -0500 Received: from sender-of-o51.zoho.com ([135.84.80.216]:21003) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eot3z-0007yn-IJ for guix-devel@gnu.org; Thu, 22 Feb 2018 10:45:39 -0500 In-reply-to: List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Hartmut Goebel Cc: guix-devel@gnu.org Hi Hartmut, I was hoping for you to show up and give your input. Thank you! I appreciate you taking the time. > re 1): This is extremely curious: Why is the older package imported, > where the newer one is expected to be first in path? > > To analyze this in detail, please make a copy of the resp. wrapper > script and change the last command into: > > exec -a "$0" python3 -m site > > and run the changed wrapper. This should show all paths defined in the > wrapper first. Since this is Python 2 I used this line: exec -a "$0" /gnu/store/0n8ni2l=E2=80=A6-python-2.7.13/bin/python -m si= te The full wrapper looks like this: --8<---------------cut here---------------start------------->8--- #!/gnu/store/f8k940vy9gck66m9r4id5m098w3hxgka-bash-minimal-4.4.12/bin/bash export PYTHONPATH=3D"/gnu/store/bz9l68hwlvwbp21msm2v002y7s8qfdd3-ribodiff-0= .2.2/lib/python2.7/site-packages:/gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7p= w-python-2.7.13/lib/python2.7/site-packages:/gnu/store/95xlp80dp36m6nllaifn= dvc1vspnxwb2-python2-mock-1.0.1/lib/python2.7/site-packages:/gnu/store/8dgq= b88wabnqscri4brwhasar7i1an1h-python2-nose-1.3.7/lib/python2.7/site-packages= :/gnu/store/xd796qc9kjaslw85jk7f81fxkql021x0-python2-numpy-1.12.0/lib/pytho= n2.7/site-packages:/gnu/store/l1gdwsx4gr23gzy8zw6n588icdhhw8z4-python2-matp= lotlib-2.0.2/lib/python2.7/site-packages:/gnu/store/prvq91x42x7wpxbjgx83y78= n23jx3jd5-python2-scipy-0.19.1/lib/python2.7/site-packages:/gnu/store/ng6sr= vhfmkz9i6g2ilbg6zksbh0v9yik-python2-statsmodels-0.8.0/lib/python2.7/site-pa= ckages:/gnu/store/vls5bci2wk15sz080g6wgycj6fmm44w9-python2-cairocffi-0.8.0/= lib/python2.7/site-packages:/gnu/store/lfnzcj977hldqhkcpivag1hwqqqzk4gr-pyt= hon2-six-1.10.0/lib/python2.7/site-packages:/gnu/store/vcs6yjy3851zn350gc90= ipw2if3rg2vj-python2-pytz-2017.3/lib/python2.7/site-packages:/gnu/store/5w9= r2c3dcz353n9rp56pcwvbks8s2hva-python2-pillow-3.3.3/lib/python2.7/site-packa= ges:/gnu/store/hl1ly62q6gsiwd287gqy354dbgrq5sxk-python2-dateutil-2.6.0/lib/= python2.7/site-packages:/gnu/store/8jwxgbcym5i1accf88bq7i8fgzg2z68q-python2= -pyparsing-2.2.0/lib/python2.7/site-packages:/gnu/store/ikx5his9njw7r7df06g= kwlayhgl2780a-python2-cycler-0.10.0/lib/python2.7/site-packages:/gnu/store/= jknf4w4s9w5w71ampcymgn4d14hfwx3h-python-2.7.13-tk/lib/python2.7/site-packag= es:/gnu/store/gdgy38ylfm4jaz4cmq6c6650i8iga21l-python2-subprocess32-3.2.7/l= ib/python2.7/site-packages:/gnu/store/pdlc7mwmm1vfrkgcpscps5kj0p1gwa14-pyth= on2-pygobject-2.28.6/lib/python2.7/site-packages:/gnu/store/s8sn8r41jyn35ag= inp63z2232sw9g23a-python2-functools32-3.2.3-2/lib/python2.7/site-packages:/= gnu/store/bj4jlrnai5qlic1arjijyp47isvipca7-python2-pycairo-1.10.0/lib/pytho= n2.7/site-packages:/gnu/store/rhc5rpihy35ss7i9fvc0knqa798br9yj-python2-pats= y-0.4.1/lib/python2.7/site-packages:/gnu/store/mrm8hn8rv04hm80sl63c1w33xs5g= g147-python2-pandas-0.19.2/lib/python2.7/site-packages:/gnu/store/q977dgwlv= mak15qn0w2kjk3q322mbrwi-python2-xcffib-0.5.1/lib/python2.7/site-packages:/g= nu/store/gmdlgpm3jyfi608fyjmj6g7svpp5y8lc-python2-cffi-1.11.2/lib/python2.7= /site-packages:/gnu/store/7fziyn0m8wjc98j0g056bms4yv94mi5q-python2-pycparse= r-2.17/lib/python2.7/site-packages${PYTHONPATH:+:}$PYTHONPATH" #exec -a "$0" "/gnu/store/bz9l68hwlvwbp21msm2v002y7s8qfdd3-ribodiff-0.2.2/b= in/.TE.py-real" "$@" exec -a "$0" /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13/bin/= python -m site --8<---------------cut here---------------end--------------->8--- While PYTHONPATH is set this prints *nothing* at all. Only after =E2=80=9C= unset PYTHONPATH=E2=80=9D I get this: --8<---------------cut here---------------start------------->8--- sys.path =3D [ '/home/uzinnal', '/gnu/store/bz9l68hwlvwbp21msm2v002y7s8qfdd3-ribodiff-0.2.2/lib/python2= .7/site-packages', '/gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13/lib/python2.= 7/site-packages', '/gnu/store/95xlp80dp36m6nllaifndvc1vspnxwb2-python2-mock-1.0.1/lib/pyt= hon2.7/site-packages', '/gnu/store/8dgqb88wabnqscri4brwhasar7i1an1h-python2-nose-1.3.7/lib/pyt= hon2.7/site-packages', '/gnu/store/xd796qc9kjaslw85jk7f81fxkql021x0-python2-numpy-1.12.0/lib/p= ython2.7/site-packages', '/gnu/store/l1gdwsx4gr23gzy8zw6n588icdhhw8z4-python2-matplotlib-2.0.2/l= ib/python2.7/site-packages', '/gnu/store/prvq91x42x7wpxbjgx83y78n23jx3jd5-python2-scipy-0.19.1/lib/p= ython2.7/site-packages', '/gnu/store/ng6srvhfmkz9i6g2ilbg6zksbh0v9yik-python2-statsmodels-0.8.0/= lib/python2.7/site-packages', '/gnu/store/vls5bci2wk15sz080g6wgycj6fmm44w9-python2-cairocffi-0.8.0/li= b/python2.7/site-packages', '/gnu/store/lfnzcj977hldqhkcpivag1hwqqqzk4gr-python2-six-1.10.0/lib/pyt= hon2.7/site-packages', '/gnu/store/vcs6yjy3851zn350gc90ipw2if3rg2vj-python2-pytz-2017.3/lib/py= thon2.7/site-packages', '/gnu/store/5w9r2c3dcz353n9rp56pcwvbks8s2hva-python2-pillow-3.3.3/lib/p= ython2.7/site-packages', '/gnu/store/hl1ly62q6gsiwd287gqy354dbgrq5sxk-python2-dateutil-2.6.0/lib= /python2.7/site-packages', '/gnu/store/8jwxgbcym5i1accf88bq7i8fgzg2z68q-python2-pyparsing-2.2.0/li= b/python2.7/site-packages', '/gnu/store/ikx5his9njw7r7df06gkwlayhgl2780a-python2-cycler-0.10.0/lib/= python2.7/site-packages', '/gnu/store/jknf4w4s9w5w71ampcymgn4d14hfwx3h-python-2.7.13-tk/lib/pytho= n2.7/site-packages', '/gnu/store/gdgy38ylfm4jaz4cmq6c6650i8iga21l-python2-subprocess32-3.2.7= /lib/python2.7/site-packages', '/gnu/store/pdlc7mwmm1vfrkgcpscps5kj0p1gwa14-python2-pygobject-2.28.6/l= ib/python2.7/site-packages', '/gnu/store/s8sn8r41jyn35aginp63z2232sw9g23a-python2-functools32-3.2.3-= 2/lib/python2.7/site-packages', '/gnu/store/bj4jlrnai5qlic1arjijyp47isvipca7-python2-pycairo-1.10.0/lib= /python2.7/site-packages', '/gnu/store/rhc5rpihy35ss7i9fvc0knqa798br9yj-python2-patsy-0.4.1/lib/py= thon2.7/site-packages', '/gnu/store/mrm8hn8rv04hm80sl63c1w33xs5gg147-python2-pandas-0.19.2/lib/= python2.7/site-packages', '/gnu/store/q977dgwlvmak15qn0w2kjk3q322mbrwi-python2-xcffib-0.5.1/lib/p= ython2.7/site-packages', '/gnu/store/gmdlgpm3jyfi608fyjmj6g7svpp5y8lc-python2-cffi-1.11.2/lib/py= thon2.7/site-packages', '/gnu/store/7fziyn0m8wjc98j0g056bms4yv94mi5q-python2-pycparser-2.17/lib= /python2.7/site-packages', '/gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13/lib/python27= .zip', '/gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13/lib/python2.= 7', '/gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13/lib/python2.= 7/plat-linux2', '/gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13/lib/python2.= 7/lib-tk', '/gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13/lib/python2.= 7/lib-old', '/gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13/lib/python2.= 7/lib-dynload', '/gnu/store/pdlc7mwmm1vfrkgcpscps5kj0p1gwa14-python2-pygobject-2.28.6/l= ib/python2.7/site-packages/gtk-2.0', ] USER_BASE: '/home/uzinnal/.local' (exists) USER_SITE: '/home/uzinnal/.local/lib/python2.7/site-packages' (doesn't exis= t) ENABLE_USER_SITE: True --8<---------------cut here---------------end--------------->8--- > If this does not give any insight, change it into > > exec -a "$0" python3 -v -c "import statsmodels" Again with =E2=80=9Cpython3=E2=80=9D replaced as =E2=80=9C/gnu/store/=E2=80= =A6-python-2.7.13/bin/python=E2=80=9D I ran this and wasn=E2=80=99t prepared for the deluge of output. The first= time statsmodels is mentioned is when the prompt appears and =E2=80=9Cimport statsmodels=E2=80=9D is executed. Interestingly it goes straight to the old statsmodels-0.6.1 instead of the newer one (0.8.0) which the wrapper added to PYTHONPATH. --8<---------------cut here---------------start------------->8--- =E2=80=A6 Python 2.7.13 (default, Jan 1 1970, 00:00:01) [GCC 5.4.0] on linux2 Type "help", "copyright", "credits" or "license" for more information. import statsmodels # directory /home/uzinnal/.guix-profile/lib/python2.7/si= te-packages/statsmodels-0.6.1-py2.7-linux-x86_64.egg/statsmodels # /home/uzinnal/.guix-profile/lib/python2.7/site-packages/statsmodels-0.6.1= -py2.7-linux-x86_64.egg/statsmodels/__init__.pyc matches /home/uzinnal/.gui= x-profile/lib/python2.7/site-packages/statsmodels-0.6.1-py2.7-linux-x86_64.= egg/statsmodels/__init__.py import statsmodels # precompiled from /home/uzinnal/.guix-profile/lib/pytho= n2.7/site-packages/statsmodels-0.6.1-py2.7-linux-x86_64.egg/statsmodels/__i= nit__.pyc # /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13/lib/python2.7/_= _future__.pyc matches /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.= 7.13/lib/python2.7/__future__.py import __future__ # precompiled from /gnu/store/0n8ni2ldvyz5yd488cidzi3via7= jk7pw-python-2.7.13/lib/python2.7/__future__.pyc import numpy # directory /gnu/store/xd796qc9kjaslw85jk7f81fxkql021x0-python= 2-numpy-1.12.0/lib/python2.7/site-packages/numpy =E2=80=A6 --8<---------------cut here---------------end--------------->8--- Here=E2=80=99s what happens before the prompt appears: --8<---------------cut here---------------start------------->8--- # installing zipimport hook import zipimport # builtin # installed zipimport hook import site # from /home/uzinnal/.guix-profile/lib/python3.4/site-packages/= site.py # can't create /home/uzinnal/.guix-profile/lib/python3.4/site-packages/site= .pyc # /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13/lib/python2.7/o= s.pyc matches /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13/lib= /python2.7/os.py import os # precompiled from /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-py= thon-2.7.13/lib/python2.7/os.pyc import errno # builtin import posix # builtin # /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13/lib/python2.7/p= osixpath.pyc matches /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7= .13/lib/python2.7/posixpath.py import posixpath # precompiled from /gnu/store/0n8ni2ldvyz5yd488cidzi3via7j= k7pw-python-2.7.13/lib/python2.7/posixpath.pyc # /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13/lib/python2.7/s= tat.pyc matches /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13/l= ib/python2.7/stat.py import stat # precompiled from /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-= python-2.7.13/lib/python2.7/stat.pyc # /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13/lib/python2.7/g= enericpath.pyc matches /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2= .7.13/lib/python2.7/genericpath.py import genericpath # precompiled from /gnu/store/0n8ni2ldvyz5yd488cidzi3via= 7jk7pw-python-2.7.13/lib/python2.7/genericpath.pyc # /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13/lib/python2.7/w= arnings.pyc matches /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.= 13/lib/python2.7/warnings.py import warnings # precompiled from /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk= 7pw-python-2.7.13/lib/python2.7/warnings.pyc # /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13/lib/python2.7/l= inecache.pyc matches /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7= .13/lib/python2.7/linecache.py import linecache # precompiled from /gnu/store/0n8ni2ldvyz5yd488cidzi3via7j= k7pw-python-2.7.13/lib/python2.7/linecache.pyc # /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13/lib/python2.7/t= ypes.pyc matches /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13/= lib/python2.7/types.py import types # precompiled from /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw= -python-2.7.13/lib/python2.7/types.pyc # /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13/lib/python2.7/U= serDict.pyc matches /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.= 13/lib/python2.7/UserDict.py import UserDict # precompiled from /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk= 7pw-python-2.7.13/lib/python2.7/UserDict.pyc # /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13/lib/python2.7/_= abcoll.pyc matches /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.1= 3/lib/python2.7/_abcoll.py import _abcoll # precompiled from /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7= pw-python-2.7.13/lib/python2.7/_abcoll.pyc # /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13/lib/python2.7/a= bc.pyc matches /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13/li= b/python2.7/abc.py import abc # precompiled from /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-p= ython-2.7.13/lib/python2.7/abc.pyc # /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13/lib/python2.7/_= weakrefset.pyc matches /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2= .7.13/lib/python2.7/_weakrefset.py import _weakrefset # precompiled from /gnu/store/0n8ni2ldvyz5yd488cidzi3via= 7jk7pw-python-2.7.13/lib/python2.7/_weakrefset.pyc import _weakref # builtin # /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13/lib/python2.7/c= opy_reg.pyc matches /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.= 13/lib/python2.7/copy_reg.py import copy_reg # precompiled from /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk= 7pw-python-2.7.13/lib/python2.7/copy_reg.pyc import imp # builtin # /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13/lib/python2.7/s= ite.pyc matches /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13/l= ib/python2.7/site.py import site # precompiled from /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-= python-2.7.13/lib/python2.7/site.pyc # /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13/lib/python2.7/t= raceback.pyc matches /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7= .13/lib/python2.7/traceback.py import traceback # precompiled from /gnu/store/0n8ni2ldvyz5yd488cidzi3via7j= k7pw-python-2.7.13/lib/python2.7/traceback.pyc # /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13/lib/python2.7/s= ysconfig.pyc matches /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7= .13/lib/python2.7/sysconfig.py import sysconfig # precompiled from /gnu/store/0n8ni2ldvyz5yd488cidzi3via7j= k7pw-python-2.7.13/lib/python2.7/sysconfig.pyc # /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13/lib/python2.7/r= e.pyc matches /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13/lib= /python2.7/re.py import re # precompiled from /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-py= thon-2.7.13/lib/python2.7/re.pyc # /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13/lib/python2.7/s= re_compile.pyc matches /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2= .7.13/lib/python2.7/sre_compile.py import sre_compile # precompiled from /gnu/store/0n8ni2ldvyz5yd488cidzi3via= 7jk7pw-python-2.7.13/lib/python2.7/sre_compile.pyc import _sre # builtin # /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13/lib/python2.7/s= re_parse.pyc matches /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7= .13/lib/python2.7/sre_parse.py import sre_parse # precompiled from /gnu/store/0n8ni2ldvyz5yd488cidzi3via7j= k7pw-python-2.7.13/lib/python2.7/sre_parse.pyc # /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13/lib/python2.7/s= re_constants.pyc matches /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python= -2.7.13/lib/python2.7/sre_constants.py import sre_constants # precompiled from /gnu/store/0n8ni2ldvyz5yd488cidzi3v= ia7jk7pw-python-2.7.13/lib/python2.7/sre_constants.pyc dlopen("/gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13/lib/pytho= n2.7/lib-dynload/_locale.so", 2); import _locale # dynamically loaded from /gnu/store/0n8ni2ldvyz5yd488cidzi3= via7jk7pw-python-2.7.13/lib/python2.7/lib-dynload/_locale.so # /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13/lib/python2.7/_= sysconfigdata.pyc matches /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-pytho= n-2.7.13/lib/python2.7/_sysconfigdata.py import _sysconfigdata # precompiled from /gnu/store/0n8ni2ldvyz5yd488cidzi3= via7jk7pw-python-2.7.13/lib/python2.7/_sysconfigdata.pyc # zipimport: found 32 names in /home/uzinnal/.guix-profile/lib/python3.4/si= te-packages/cairocffi-0.6-py3.4.egg # zipimport: found 609 names in /gnu/store/jjx8l3mxszklsq80hdpjv08yd9j14hc8= -python-pytz-2016.3/lib/python3.4/site-packages/pytz-2016.3-py3.4.egg # zipimport: found 31 names in /gnu/store/sdddqkk41g9x895kmsd28v1mniiccwpi-= python-dateutil-2.5.2/lib/python3.4/site-packages/python_dateutil-2.5.2-py3= .4.egg # zipimport: found 32 names in /home/uzinnal/.guix-profile/lib/python2.7/si= te-packages/cairocffi-0.6-py2.7.egg # zipimport: found 31 names in /gnu/store/xdmyyznc45vcfgrygrq50lbk0z89321k-= python2-dateutil-2.5.2/lib/python2.7/site-packages/python_dateutil-2.5.2-py= 2.7.egg import encodings # directory /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-py= thon-2.7.13/lib/python2.7/encodings # /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13/lib/python2.7/e= ncodings/__init__.pyc matches /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-p= ython-2.7.13/lib/python2.7/encodings/__init__.py import encodings # precompiled from /gnu/store/0n8ni2ldvyz5yd488cidzi3via7j= k7pw-python-2.7.13/lib/python2.7/encodings/__init__.pyc # /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13/lib/python2.7/c= odecs.pyc matches /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13= /lib/python2.7/codecs.py import codecs # precompiled from /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7p= w-python-2.7.13/lib/python2.7/codecs.pyc import _codecs # builtin # /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13/lib/python2.7/e= ncodings/aliases.pyc matches /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-py= thon-2.7.13/lib/python2.7/encodings/aliases.py import encodings.aliases # precompiled from /gnu/store/0n8ni2ldvyz5yd488cid= zi3via7jk7pw-python-2.7.13/lib/python2.7/encodings/aliases.pyc # /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-python-2.7.13/lib/python2.7/e= ncodings/utf_8.pyc matches /gnu/store/0n8ni2ldvyz5yd488cidzi3via7jk7pw-pyth= on-2.7.13/lib/python2.7/encodings/utf_8.py import encodings.utf_8 # precompiled from /gnu/store/0n8ni2ldvyz5yd488cidzi= 3via7jk7pw-python-2.7.13/lib/python2.7/encodings/utf_8.pyc --8<---------------cut here---------------end--------------->8--- Note that =E2=80=9Cimport site=E2=80=9D is satisfied by Python 3, but the b= ehaviour is the same when I only keep Python 2 things on the PYTHONPATH. With =E2=80=9C-vvvv=E2=80=9D I see that the directory containing statsmodel= s-0.8.0 is in fact accessed multiple times for =E2=80=9C{site,os,posixpath,stat,genericpath,warnings}.{so,py,pyc}=E2=80=9D= and many more; but when the time comes to =E2=80=9Cimport statsmodels=E2=80=9D it lo= ads it from the 0.6.1 directory; it does not look it up in the 0.8.0 directory. --8<---------------cut here---------------start------------->8--- Python 2.7.13 (default, Jan 1 1970, 00:00:01) [GCC 5.4.0] on linux2 Type "help", "copyright", "credits" or "license" for more information. # trying statsmodels.so # trying statsmodelsmodule.so # trying statsmodels.py # trying statsmodels.pyc # trying /gnu/store/b0qkrrkiw0gszw6hdxcbyly6nr9ln7n3-python2-cffi-1.4.2/lib= /python2.7/site-packages/cffi-1.4.2-py2.7-linux-x86_64.egg/statsmodels.so # trying /gnu/store/b0qkrrkiw0gszw6hdxcbyly6nr9ln7n3-python2-cffi-1.4.2/lib= /python2.7/site-packages/cffi-1.4.2-py2.7-linux-x86_64.egg/statsmodelsmodul= e.so # trying /gnu/store/b0qkrrkiw0gszw6hdxcbyly6nr9ln7n3-python2-cffi-1.4.2/lib= /python2.7/site-packages/cffi-1.4.2-py2.7-linux-x86_64.egg/statsmodels.py # trying /gnu/store/b0qkrrkiw0gszw6hdxcbyly6nr9ln7n3-python2-cffi-1.4.2/lib= /python2.7/site-packages/cffi-1.4.2-py2.7-linux-x86_64.egg/statsmodels.pyc # trying /home/uzinnal/.guix-profile/lib/python2.7/site-packages/cffi-1.4.2= -py2.7-linux-x86_64.egg/statsmodels.so # trying /home/uzinnal/.guix-profile/lib/python2.7/site-packages/cffi-1.4.2= -py2.7-linux-x86_64.egg/statsmodelsmodule.so # trying /home/uzinnal/.guix-profile/lib/python2.7/site-packages/cffi-1.4.2= -py2.7-linux-x86_64.egg/statsmodels.py # trying /home/uzinnal/.guix-profile/lib/python2.7/site-packages/cffi-1.4.2= -py2.7-linux-x86_64.egg/statsmodels.pyc # trying /home/uzinnal/.guix-profile/lib/python2.7/site-packages/matplotlib= -1.4.3-py2.7-linux-x86_64.egg/statsmodels.so # trying /home/uzinnal/.guix-profile/lib/python2.7/site-packages/matplotlib= -1.4.3-py2.7-linux-x86_64.egg/statsmodelsmodule.so # trying /home/uzinnal/.guix-profile/lib/python2.7/site-packages/matplotlib= -1.4.3-py2.7-linux-x86_64.egg/statsmodels.py # trying /home/uzinnal/.guix-profile/lib/python2.7/site-packages/matplotlib= -1.4.3-py2.7-linux-x86_64.egg/statsmodels.pyc # trying /gnu/store/8707rsnrfi3f747pj1jvxr7bwb0kk982-python2-nose-1.3.7/lib= /python2.7/site-packages/nose-1.3.7-py2.7.egg/statsmodels.so # trying /gnu/store/8707rsnrfi3f747pj1jvxr7bwb0kk982-python2-nose-1.3.7/lib= /python2.7/site-packages/nose-1.3.7-py2.7.egg/statsmodelsmodule.so # trying /gnu/store/8707rsnrfi3f747pj1jvxr7bwb0kk982-python2-nose-1.3.7/lib= /python2.7/site-packages/nose-1.3.7-py2.7.egg/statsmodels.py # trying /gnu/store/8707rsnrfi3f747pj1jvxr7bwb0kk982-python2-nose-1.3.7/lib= /python2.7/site-packages/nose-1.3.7-py2.7.egg/statsmodels.pyc # trying /gnu/store/g6pi1k1py80ah53ig7g34pgp0gr2kr74-python2-six-1.10.0/lib= /python2.7/site-packages/six-1.10.0-py2.7.egg/statsmodels.so # trying /gnu/store/g6pi1k1py80ah53ig7g34pgp0gr2kr74-python2-six-1.10.0/lib= /python2.7/site-packages/six-1.10.0-py2.7.egg/statsmodelsmodule.so # trying /gnu/store/g6pi1k1py80ah53ig7g34pgp0gr2kr74-python2-six-1.10.0/lib= /python2.7/site-packages/six-1.10.0-py2.7.egg/statsmodels.py # trying /gnu/store/g6pi1k1py80ah53ig7g34pgp0gr2kr74-python2-six-1.10.0/lib= /python2.7/site-packages/six-1.10.0-py2.7.egg/statsmodels.pyc # trying /home/uzinnal/.guix-profile/lib/python2.7/site-packages/pandas-0.1= 8.1-py2.7-linux-x86_64.egg/statsmodels.so # trying /home/uzinnal/.guix-profile/lib/python2.7/site-packages/pandas-0.1= 8.1-py2.7-linux-x86_64.egg/statsmodelsmodule.so # trying /home/uzinnal/.guix-profile/lib/python2.7/site-packages/pandas-0.1= 8.1-py2.7-linux-x86_64.egg/statsmodels.py # trying /home/uzinnal/.guix-profile/lib/python2.7/site-packages/pandas-0.1= 8.1-py2.7-linux-x86_64.egg/statsmodels.pyc # trying /home/uzinnal/.guix-profile/lib/python2.7/site-packages/six-1.10.0= -py2.7.egg/statsmodels.so # trying /home/uzinnal/.guix-profile/lib/python2.7/site-packages/six-1.10.0= -py2.7.egg/statsmodelsmodule.so # trying /home/uzinnal/.guix-profile/lib/python2.7/site-packages/six-1.10.0= -py2.7.egg/statsmodels.py # trying /home/uzinnal/.guix-profile/lib/python2.7/site-packages/six-1.10.0= -py2.7.egg/statsmodels.pyc import statsmodels # directory /home/uzinnal/.guix-profile/lib/python2.7/si= te-packages/statsmodels-0.6.1-py2.7-linux-x86_64.egg/statsmodels # trying /home/uzinnal/.guix-profile/lib/python2.7/site-packages/statsmodel= s-0.6.1-py2.7-linux-x86_64.egg/statsmodels/__init__.so # trying /home/uzinnal/.guix-profile/lib/python2.7/site-packages/statsmodel= s-0.6.1-py2.7-linux-x86_64.egg/statsmodels/__init__module.so # trying /home/uzinnal/.guix-profile/lib/python2.7/site-packages/statsmodel= s-0.6.1-py2.7-linux-x86_64.egg/statsmodels/__init__.py # /home/uzinnal/.guix-profile/lib/python2.7/site-packages/statsmodels-0.6.1= -py2.7-linux-x86_64.egg/statsmodels/__init__.pyc matches /home/uzinnal/.gui= x-profile/lib/python2.7/site-packages/statsmodels-0.6.1-py2.7-linux-x86_64.= egg/statsmodels/__init__.py import statsmodels # precompiled from /home/uzinnal/.guix-profile/lib/pytho= n2.7/site-packages/statsmodels-0.6.1-py2.7-linux-x86_64.egg/statsmodels/__i= nit__.pyc --8<---------------cut here---------------end--------------->8--- Note that lib/python2.7/site-packages (which is on the user=E2=80=99s PYTHONPATH) contains a file =E2=80=9Cpython2-statsmodels-0.6.1.pth=E2=80=9D= . Does this play a role here? > exec -a "$0" python3 -v -c "import ribodiff.estimatedisp" > > and try to find some insight there. Unfortunately, this didn=E2=80=99t tell me much more than the previous comm= and. After numpy is loaded, the old statsmodels is loaded. > re 2): As soon as Python2 and Python3 are installed in the same profile, > we put both site-packages for both versions into PYTHONPATH, which > obviously is wrong. > > $ PYTHONPATH=3D guix environment --ad-hoc python@2 python > [=E2=80=A6] > [guix] $ echo $PYTHONPATH > /gnu/store/jkwp041kjy6li85n66ymxkfrr0hr2psj-profile/lib/python2.7/site-pa= ckages:/gnu/store/jkwp041kjy6li85n66ymxkfrr0hr2psj-profile/lib/python3.5/si= te-packages: > > A simple work-around would be to make the profile a (pseudo) virtual > environment, which is a easy as creating a file > "/gnu/store/=E2=80=A6-profile/pyvenv.cfg". This will trigger a mechanism = in > site.py to insert /gnu/store/=E2=80=A6-profile/lib/pythonX.Y/site-package= s" into > sys.path - for the current python version only! This is very good to know. I haven=E2=80=99t tested this (as I=E2=80=99m n= ot editing the store by hand), but I suppose we could create an empty pyvenv.cfg in a profile hook when Python packages are installed. (This wouldn=E2=80=99t help us much for wrapper scripts, though.) -- Ricardo GPG: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC https://elephly.net