0
我想在Python 2.7上使用distutils
创建一个包安装程序。Python Distutils包分发
这里是我的setup.py
:
from distutils.core import setup
import distutils.command.bdist as bdist
setup_options = {
'name': 'tk',
'version': '1.0',
'description': 'Graphics package that supplements native Tkinter',
'package_dir': {'tk': ''},
# this is because setup.py is in the same directory as the package contents
'packages': ['tk', 'tk.latex'],
}
setup(**setup_options)
使用python setup.py bdist --format=wininst
,然后用7-Zip的通过可执行一看,我发现文件和文件夹的这个目录:
PURELIB/ # excepted for the executable
tk/ # also expected
latex/ # subpackage, should not be here
some_file_in_tk.py # this should only be located in tk, not in this main directory
在使用上安装另一台计算机,它按照预期在site-packages
下安装tk
程序包。但是,它也安装latex
子包(tk
)和tk
中的所有其他文件。为什么会发生这种情况,我可以解决这个问题吗?谢谢!