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

2024-03-29 12:17:52 发布

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

我只是做了一个小应用,然后为它写了一个setup.py文件。一切似乎都在运转,只是我搞不懂一件小事。在

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

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

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


Tags: 文件py目录文件夹libusr选项setup
1条回答
网友
1楼 · 发布于 2024-03-29 12:17:52

我想你想要一个sdist输出。。。。所以试试python设置.pysdist公司

引用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

相关问题 更多 >