Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #83642 > unrolled thread

What does "pip install" do?

Started byFabien <fabien.maussion@gmail.com>
First post2015-01-12 23:35 +0100
Last post2015-01-14 22:08 +1100
Articles 5 — 3 participants

Back to article view | Back to comp.lang.python


Contents

  What does "pip install" do? Fabien <fabien.maussion@gmail.com> - 2015-01-12 23:35 +0100
    Re: What does "pip install" do? Chris Angelico <rosuav@gmail.com> - 2015-01-13 09:46 +1100
      Re: What does "pip install" do? Fabien <fabien.maussion@gmail.com> - 2015-01-13 08:51 +0100
        Re: What does "pip install" do? Chris Angelico <rosuav@gmail.com> - 2015-01-13 18:59 +1100
        Re: What does "pip install" do? Ben Finney <ben+python@benfinney.id.au> - 2015-01-14 22:08 +1100

#83642 — What does "pip install" do?

FromFabien <fabien.maussion@gmail.com>
Date2015-01-12 23:35 +0100
SubjectWhat does "pip install" do?
Message-ID<m91i6i$3ft$1@speranza.aioe.org>
Folks,

I've learned a lot today about python packaging and stuff, thanks to a 
couple of good websites. I've learned how to install a package from PyPi 
with pip, choose which version, upgrade it, uninstall it, use 
virtualenv, BUT I'm still asking myself: what does "pip install" 
*concretely* do on my virtual environment?

It seems to add a directory in the /site-packages directory, but what 
does it do when for example command-line scripts are shipped with it? Is 
something else happening in the background?

Neither does the "Python Packaging Authority" website 
(https://pip.pypa.io/en/latest/user_guide.html) nor the 
"python-packaging-user-guide" 
(http://python-packaging-user-guide.readthedocs.org/en/latest/installing.html) 
nor the "Installing python packages" from the python docs 
(https://docs.python.org/3/installing/) seem to provide an answer to 
this question.

Or did I simply miss it?

Thanks!

Fabien

[toc] | [next] | [standalone]


#83645

FromChris Angelico <rosuav@gmail.com>
Date2015-01-13 09:46 +1100
Message-ID<mailman.17646.1421102814.18130.python-list@python.org>
In reply to#83642
On Tue, Jan 13, 2015 at 9:35 AM, Fabien <fabien.maussion@gmail.com> wrote:
>
> I've learned a lot today about python packaging and stuff, thanks to a
> couple of good websites. I've learned how to install a package from PyPi
> with pip, choose which version, upgrade it, uninstall it, use virtualenv,
> BUT I'm still asking myself: what does "pip install" *concretely* do on my
> virtual environment?

As far as I know, it's equivalent to three steps:

1) Download the appropriate version of a package (the latest, if you
didn't say otherwise)
2) Extract that package
3) Run 'python setup.py'.

What setup.py does is up to the package, but for a pure-Python package
it should simply create something in site-packages. It might do a lot
more, though - compiling C or Fortran code, for instance.

ChrisA

[toc] | [prev] | [next] | [standalone]


#83671

FromFabien <fabien.maussion@gmail.com>
Date2015-01-13 08:51 +0100
Message-ID<m92iqd$7ko$1@speranza.aioe.org>
In reply to#83645
On 12.01.2015 23:46, Chris Angelico wrote:
> On Tue, Jan 13, 2015 at 9:35 AM, Fabien<fabien.maussion@gmail.com>  wrote:
>> >BUT I'm still asking myself: what does "pip install"*concretely*  do on my
>> >virtual environment?
> As far as I know, it's equivalent to three steps:
>
> 1) Download the appropriate version of a package (the latest, if you
> didn't say otherwise)
> 2) Extract that package
> 3) Run 'python setup.py'.
>
> What setup.py does is up to the package, but for a pure-Python package
> it should simply create something in site-packages. It might do a lot
> more, though - compiling C or Fortran code, for instance.

Thanks Chris. I should then rephrase my question to "what does python 
setup.pt do?" ;-). My point was also that I think that this information 
(mostly: what will change on my system or my virtual env when I install 
a python package?) could/should be provided in the mentioned resources:

"Python Packaging Authority" website 
(https://pip.pypa.io/en/latest/user_guide.html),
"python-packaging-user-guide" 
(http://python-packaging-user-guide.readthedocs.org/en/latest/installing.html) 

"Installing python packages" from the python docs 
(https://docs.python.org/3/installing/)

I've found a bit more about this ("How installation works") in the 
Python 3 doc which is now considered legacy and might therefore not be 
read:
https://docs.python.org/3.4/install/index.html#installing-python-modules-legacy-version

Fabien



[toc] | [prev] | [next] | [standalone]


#83672

FromChris Angelico <rosuav@gmail.com>
Date2015-01-13 18:59 +1100
Message-ID<mailman.17662.1421135954.18130.python-list@python.org>
In reply to#83671
On Tue, Jan 13, 2015 at 6:51 PM, Fabien <fabien.maussion@gmail.com> wrote:
> Thanks Chris. I should then rephrase my question to "what does python
> setup.pt do?" ;-). My point was also that I think that this information
> (mostly: what will change on my system or my virtual env when I install a
> python package?) could/should be provided in the mentioned resources:

You'd have to look at the individual packages' setup.py files, I guess.

ChrisA

[toc] | [prev] | [next] | [standalone]


#83744

FromBen Finney <ben+python@benfinney.id.au>
Date2015-01-14 22:08 +1100
Message-ID<mailman.17712.1421233733.18130.python-list@python.org>
In reply to#83671
Fabien <fabien.maussion@gmail.com> writes:

> On 12.01.2015 23:46, Chris Angelico wrote:
> > As far as I know, it's equivalent to three steps:
> >
> > 1) Download the appropriate version of a package (the latest, if you
> > didn't say otherwise)
> > 2) Extract that package
> > 3) Run 'python setup.py'.
> >
> > What setup.py does is up to the package, but for a pure-Python
> > package it should simply create something in site-packages. It might
> > do a lot more, though - compiling C or Fortran code, for instance.
>
> Thanks Chris. I should then rephrase my question to "what does python
> setup.pt do?" ;-).

You're re-phrasing that as a question which has already been answered,
though. What ‘setup.py’ actually does is up to each package. Some are
quite small and simple; others are large complex applications.

> My point was also that I think that this information (mostly: what
> will change on my system or my virtual env when I install a python
> package?) could/should be provided in the mentioned resources:
>
> "Python Packaging Authority" website
> (https://pip.pypa.io/en/latest/user_guide.html),
> "python-packaging-user-guide"
> (http://python-packaging-user-guide.readthedocs.org/en/latest/installing.html)

Why, though? The point of an end-user program is that an end-user should
not need to be bothered by what it does internally, only what the
observable behaviour is. In the case of ‘pip install’, the observable
behaviour is that a package is installed and ready for use.

Your questions drive ever toward “What is the *implementation* of this?”
which is not material suitable for a user guide — especially when the
implementation details are in much more appropriate documents
<URL:https://python-packaging-user-guide.readthedocs.org/en/latest/distributing.html>
<URL:https://python-packaging-user-guide.readthedocs.org/en/latest/additional.html>.

If you want to learn about the internals and the implementation details,
you are expressly moving beyond the scope of the user guide. There's
nothing wrong with doing that, but you need to recognise the shift and
look for the appropriate documentation.

-- 
 \      “The most common way people give up their power is by thinking |
  `\                               they don't have any.” —Alice Walker |
_o__)                                                                  |
Ben Finney

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web