[Tutor] Python packaging Was:Re: sys.path.append import python3 not working

Oscar Benjamin oscar.j.benjamin at gmail.com
Wed Feb 5 20:36:20 CET 2014


On 5 February 2014 16:42, ALAN GAULD <alan.gauld at btinternet.com> wrote:
>
>> And after 15 years of using Python I didn't know it existed until now!
>> I've always used a local directory and added it to PYTHONPATH...
>
> Then maybe you're also not aware of the --user option for
> pip/easy_install. That's how I discovered the user site-packages
> directory.
>
> To be honest I've not really used pip or easy_install much.
> Most of what I do uses the standard library. The only extra packages
> I use are BeautifulSoup(very rarely) and wxPython(also rarely)
> and TurboGears and Django once each.
>
> In fact, one of the things I'm playing with just now is the whole
> distutils packaging thing and reading up on eggs etc. Frankly it's
> all a bit of a mess and I hope the promised improvements from
> Python 3.4 onwards will make it a lot less messy!

The only improvement Python 3.4 brings is that pip and setuptools will
usually be bundled with Python so that you don't need to install them
separately. Any other improvements will be available to all Python
versions provided you update pip and setuptools. (Many people will
always do this stuff in virtualenvs so that they're always using
newest pip and setuptools).

If you're not looking to package/install C extensions then actually
the situation right now is pretty good. Distutils, pip, setuptools and
PyPI work pretty well for distributing pure Python code. It's also
straight-forward to have dependencies on other packages on PyPI that
will be resolved automatically when the user asks to install your
package.

The wheel format is supposed to replace the (effectively deprecated)
egg format and makes it viable to distribute precompiled C extensions
for Windows users (and soon for OSX users also). It's not clear how
viable that will ever be on Linux et al because of the different libc
ABIs.


Oscar


More information about the Tutor mailing list