Simple graphic library for beginners

Chris Angelico rosuav at gmail.com
Thu Jan 11 20:14:03 EST 2018


On Fri, Jan 12, 2018 at 11:57 AM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
> On Fri, 12 Jan 2018 05:42:03 +1100, Chris Angelico wrote:
>
>> On Fri, Jan 12, 2018 at 5:33 AM, bartc <bc at freeuk.com> wrote:
> [...]
>>> Except my Python 3.6 doesn't have pip. There is a however a copy in my
>>> Python 3.4. But that gives me the message:
>>
>> Why doesn't it? Recent Pythons should include pip by default.
>
> Not quite.
>
> Recent Pythons include "ensure pip" by default, which is a private
> version of pip which is intended to do nothing but install the latest
> version of pip.

True, but a fresh installation on Windows is supposed to let you just
leave the box ticked and it runs ensurepip so you have pip.

>> If you've broken your pip in some way, we won't be able to help you
>> debug it with just this. Figure out why your Python 3.6 doesn't have a
>> working pip, because that IS the normal and obvious thing to do.
>
> Just because you have installed Python doesn't mean that pip will be
> automatically installed and `pip ...` work from the shell.
>
> There's also the problem that while you can easily install multiple
> versions of Python without them clashing, the same doesn't apply to "pip".
>
> How do you know which version of Python `pip install foo` will use? How
> do I choose the version pip will install into? [not rhetorical questions]
> Don't say "use venv", because using a virtual environment shouldn't be a
> prerequisite for using pip.

The recommendation was already given to use "python3 -m pip". That
gets around those problems.

> How do I deal with permissions errors? [semi-rhetorical question -- I
> know *an* answer, but I don't know if it is the *right* answer]

That's a fair point, but a perms error is reported properly by pip.
How do you deal with it? First you recognize that there's a problem.
Nothing in this thread suggested that there were perms problems to
deal with.

> I keep hearing people say that pip is the greatest thing since sliced
> bread, but my own personal experience with it is that installing pip is
> only half the battle.
>
> If it works for you, great -- but some of us have had so many problems
> getting pip to work that we've gone back to just installing from source.
>
> (Admittedly installing from source is probably harder for Windows users
> than Linux users.)

Correct. On Windows, I don't know of ANYONE who installs packages from
source who is not already a Python developer. You don't just revert to
source when pip starts having issues.

I wouldn't say that pip is perfect - there are certainly a number of
issues with it (some of which are NOT issues with similar programs
like npm (Node), gem (Ruby), etc - so there's things pip can perhaps
learn from them) - but it is far easier than the Windows alternative,
which is "track down a binary, make sure it matches your Python, and
then install it".

(Pure Python packages are much easier, but pygame is an extension and
has to be compiled. So do many others.)

Compiling software from source is reasonably common among Linux users,
so it's unsurprising for us to go "oh, I need those dev libraries".
When I wanted to spin up Jekyll to do local testing prior to pushing
stuff to GitHub Pages, I followed the directions, then got an error
that required me to install the Ruby dev headers, and that didn't faze
me. But if someone on Windows had the same problem, it'd likely be a
much bigger deal - firstly because you can't just "sudo apt install
ruby-dev", and secondly because Windows systems usually don't have a C
compiler installed. I'm massively overgeneralizing here, but if you
were to poll a thousand Linux users and a thousand Windows users,
you'd find a far higher proportion of the former are comfortable
building random software from source.

But even with that caveat, I still think pip is worth using *on
Linux*. For your system Python, use your system package manager; for a
Python installed from source, use pip.

ChrisA



More information about the Python-list mailing list