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
中的所有其他文件。爲什麼會發生這種情況,我可以解決這個問題嗎?謝謝!