gpt4 book ai didi

python - 关于 bdist 目录层次结构的问题

转载 作者:行者123 更新时间:2023-12-01 14:38:39 24 4
gpt4 key购买 nike

我刚刚制作了一个小应用程序,然后为其编写了一个 setup.py 文件。一切似乎都正常,除了我想不出一件小事。

bdist 选项传递给 setup.py 时,它会创建存档 gzip 压缩的 tar 文件。当我打开该文件时,我注意到目录结构是:

> usr
> lib
> python2.6
> site-packages
> Folder 1
> Folder 2

这是什么原因?通常,我希望文件夹 1 和文件夹 2 位于根目录中。为什么 bdist 添加顶级目录?有什么办法可以摆脱它们(更重要的是,我应该摆脱它们吗?)

最佳答案

我想你想要一个 sdist 输出....所以试试 python setup.py sdist

Python 文档引用

As a simple example, if I run the following command in the Distutils source tree:

python setup.py bdist

then the Distutils builds my module distribution (the Distutils itself in this case), does a “fake” installation (also in the build directory), and creates the default type of built distribution for my platform. The default format for built distributions is a “dumb” tar file on Unix, and a simple executable installer on Windows. (That tar file is considered “dumb” because it has to be unpacked in a specific location to work.)

参见 Python Documentation

关于python - 关于 bdist 目录层次结构的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3483243/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com