[Distutils] can someone explain why I have started to get these pip failures
Robin Becker
robin at reportlab.com
Thu Jul 14 12:23:24 EDT 2016
On 14/07/2016 16:14, Jeremy Stanley wrote:
> On 2016-07-14 16:01:23 +0100 (+0100), Robin Becker wrote:
>> On 14/07/2016 15:41, Ian Cordasco wrote:
>>> Try:
.............
>>
>> I would like to try and understand this happens as then I might have some
>> wya of fixing it.
>
> You really should avoid mixing pip-installed packages in the system
> context with distro-provided Python libraries, otherwise you will
> run into these sorts of issues constantly. I help maintain some
not really sure why this is an issue. All of my problems are in virtual
environments and I never use the --system-site-packages flag.
I have never used pip to install anything system wide (so far as I know).
Step 0 in after setting up an environment is pip install -U pip setuptools
Of course you are right in that the python is a distro provided one; and also
the pip and virtualenv etc etc.
> very, very large test infrastructure for Python-based tools and
> libraries: in scenarios where we use pip to install anything
> system-wide we first make sure to scrub every last distro-provided
> Python library from the system along with any other Python-based
> applications that might depend on them, and only then we bootstrap
> pip completely independent of distro packaging (downloading and
> running get-pip.py). Also whenever possible, we instead rely on pip
> install within virtualenvs _without_ --system-site-packages, so that
> there's no risk of interaction with any Python libraries that might
> somehow get subsequently installed on the system.
>
I used always to build python from source in older ubuntus, but that was because
we wanted the latest python 2.x etc etc. Using a local copy prevents the os from
smashing stuff, but means more work whenever a serious upgrade is required.
When I run python -mvirtualenv I end up with an environment that has pip and
setuptools already. Are you saying I should do
/usr/bin/python -mvirtualenv --no-pip --no-setuptools myenv
myenv/bin/python get_pip.py
and then proceed from there? Or is it foolish to rely on the system python at all?
I haven't seen this problem in ubuntu 14.04, but that may be just luck.
I certainly notice some new behaviour ie the system pip seems to want to assert
--user whereas it used to fail for lack of rights in installing into
/usr/lib/python....
--
Robin Becker
More information about the Distutils-SIG
mailing list