开发者

Incorrect data_files location using distutils

开发者 https://www.devze.com 2023-01-08 03:48 出处:网络
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),

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).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号