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

2024-04-25 11:48:29 发布

您现在位置:Python中文网/ 问答频道 /正文

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


Tags: 路径目录myappopt
1条回答
网友
1楼 · 发布于 2024-04-25 11:48:29

我找到了一个我可以接受的方法:

1/ Make setup configuration file .

2/ Add the following to the configuration file :

[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。 对我来说很好。在

相关问题 更多 >