The distutils documentation specifies that when the target directory for data_files is a 开发者_如何学JAVArelative path, the files will be installed relative to sys.prefix
. On my system (Linux Mint), this is /usr
; however, the data_files are instead installing to /usr/local
.
How can I correct this without losing cross-platform support?
This is an Ubuntu / Linux mint related issue, they default to /usr/local
instead of /usr
.
[1] http://ubuntuforums.org/showthread.php?t=1121501
Are you trying to 1) install someone else's program or 2) write a setup.py yourself?
If 1), are you appending --prefix=/usr/local
when invoking python setup.py
? If so, installation prefix will become /usr/local
, to which the data files will be installed relative.
If 2), check out the value of sys.prefix
& sys.exec_prefix
(or post the relating part of your setup.py).
First, you should check the sys.prefix for the Python you use to run the setup script.
Second, check distutils configuration files (one is distutils.cfg in the Python standard library directory (yuck, I know), another is ~/.pydistutils.cfg, the last is the optional setup.cfg that follows setup.py).
精彩评论