Installing my sdist from PyPI puts the files in unexpected places?

The data_files parameter is for data files who isn't a part of the package. You should probably use package_data instead.

The data_files parameter is for data files who isn't a part of the package. You should probably use package_data instead. See packages.python.org/distribute/setuptool... That wouldn't install the data in site-packages/data, but in my opinion that's not where is should be installed anyway.

You won't know which package it's a part of. It should be installed in site-packages//gloopy-0.1. Alpha-py2.7.Egg/data|doc|examples IMO.

If you really do think the data is not package data, then you should use data_files and in that case pip installs it correctly, while I'd claim setup. Py install installs it in the wrong place. But in my opinion, in this case, it is package_data, as it's related to the package, and not used by other software.

I absolutely agree with you that data|doc|examples should be installed inside site-packages/gloopy-0.1. Alpha-py2.7.egg. Your implication that 'data_files' should only be used by data that is used by other software is illuminating for me.

Thank you. – Jonathan Hartley Mar 4 at 12:23 Oops, your answer alerted me that I'd drawn the directory layout for a local sdist install wrong. 'data' etc did not go into site-packages, but into site-packages/gloopy-0.1.

Alpha-py2.7. Egg, just as you suggested it should. Fixed now. – Jonathan Hartley Mar 4 at 12:28 @Tartley: Ah.

Good. I do wonder why there is a difference there. We really need to get the install story straight in Python.

(Hopefully distutils2 will do that). – Lennart Regebro Mar 4 at 12:55.

You can load package data with pkgutil. Get_data(), it will find where exactly package data is installed. Here is a nice blog post about including data files in packages: Including data files into Python packages.

Brilliant - thanks for the answer. Reviewing the links, I think the important nugget which you didn't mention explicitly is that I should always be using 'package_data' in my setup. Py, rather than 'data_files'.

Is the consensus therefore that 'data_files' should never be used? This puzzles me, because it contradicts my understanding of how to lay out directories in a Python project, in that it implies your 'data' dir goes inside your package source dir, not alongside it. – Jonathan Hartley Mar 4 at 12:09.

You can load package data with pkgutil. Get_data(), it will find where exactly package data is installed.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions