setup.py脚本,如何将包安装到自定义目录?

时间:2013-11-17 23:46:22

标签: python installation distutils

如何将我的软件包安装到备用目录(例如/ opt / myapp)而不是通常的第三方python路径?

1 个答案:

答案 0 :(得分:3)

我发现这种方式对我来说是接受的:

  

1 /制作设置配置文件。

     

2 /将以下内容添加到配置文件中:

[install]
install-base=    # custom path
install-purelib= # custom path
install-platlib= # add custom path
install-scripts=  # add custom path
install-data=      # add custom path 
install-headers=    #add custom path 

这比强制用户在命令行中指定它们更好,此外他可以覆盖此conf。从命令行。 它对我来说很好。

相关问题