1

I'm trying to get data files for my python project to get installed at a particular location.

I am trying the --python-install-data location-to-install-data-files option in the fpm command that generates the rpm. When I do rpm -i package-path.rpm, I expect the data files to be installed at the location specified in the fpm command. Yet that is not happening. What could be the problem?

Prachi
  • 528
  • 8
  • 31
  • What version of `fpm` are you using? Does using `--install-data` work? – Etan Reisner Oct 19 '15 at 17:14
  • When I do `python setup.py install_data`, I get an error `File "/usr/lib64/python2.6/distutils/command/install_data.py", line 50, in run for f in self.data_files: TypeError: 'NoneType' object is not iterable` which means that the data files is None. – Prachi Oct 19 '15 at 17:52
  • When you run that on what? Is your problem then that your python package doesn't define any data files? So it doesn't matter what you specify for `--python-install-data` because there's nothing to use that value? – Etan Reisner Oct 19 '15 at 17:54
  • I did specify my data file in the `package_data` field of the setup command. Do you mean that I should use the `data_files` field instead? – Prachi Oct 19 '15 at 17:58
  • I don't know. I don't use `setup.py` (or `fpm` for that matter). You tell me. What does `install_data` deal with? What sort of files are you trying to install this way? What path is `fpm` using? What path do you want it to use instead? – Etan Reisner Oct 19 '15 at 18:05
  • Based on the setup.py documentation, `package_data` is used for data within the source code packages. The `data_files` is used for data files external to the source code. Since my data file is within the source code package, so I used the `package_data` field. I want to install it to a separate location (i.e. not the python site-packages location where the project gets installed by default). As per fpm documentation, you can specify the location where you want to install the data files with the `--python-install-data` option. – Prachi Oct 19 '15 at 18:28
  • 1
    I think you might want `prefix` instead of `install_data` for that but I'm not sure. It looks like `--python-install-data` is for `data_files` and not `package_data` though. – Etan Reisner Oct 19 '15 at 18:36
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/92765/discussion-between-prachi-and-etan-reisner). – Prachi Oct 19 '15 at 19:27

0 Answers0