[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Anomalies in Python search-path
From: |
Hartmut Goebel |
Subject: |
Re: Anomalies in Python search-path |
Date: |
Mon, 16 Jan 2017 10:30:59 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
Am 15.01.2017 um 23:10 schrieb Ludovic Courtès:
>> > My last reporting that pip was working correctly in non-environment was
>> > wrong because I had failed to logout/login after installing the python
>> > package; after doing so, the behavior is the same as in an environment:
>> > the user site location (~/.local/...) comes after site-packages rather
>> > than before, as would normally be the case. Apparently this is due to
>> > setting a site-packages location with the environment variable
>> > PYTHONPATH, which has precedence over the user site location.
> ~/.guix-profile/etc/profile prepends things to the search paths, but
> it’s up to the user whether to source it before or after other
> definitions have been provided (in .bash_profile or similar).
Maxim is talking about how python is processing the paths.
The "normal" order is:
- $PYTHONPATH (which normaly does not include site-packages)
- Python Standard library (not including site-packages)
- user's site-packages (~/.local/lib/python3.4/site-packages)
- global site-packages (/usr/lib/python3.4/site-packages)
The user's site-packages take precedence over the global ones.
In Guix we currently use PYTHONPATH to add global site-packages. Since
PYTHONPATH parts are put in front of the search list, they take
precedence over the user's site-packages. And this behaviour is wrong.
--
Regards
Hartmut Goebel
| Hartmut Goebel | address@hidden |
| www.crazy-compilers.com | compilers which you thought are impossible |
Anomalies in Python search-path (was: [PATCH] Update python-pip to 9.0.1), Hartmut Goebel, 2017/01/14