问题描述
我想运行 python setup.py install
(安装脚本使用 setuptools),并且我只想将 .pyc 文件包含在生成的 egg 或目录中.不得存在所有 .py 文件.我该怎么做?
I want to run python setup.py install
(the setup script uses setuptools), and I want only the .pyc files to be included in the resulting egg or directory. all .py files must not be present. How can I do this ?
推荐答案
不使用 install
,但可以运行以下命令
not with install
, but a possibility is to run the following command
python setup.py bdist_egg --exclude-source-files
并使用easy_install将生成的egg安装到dist
and install the resulting egg in dist with easy_install
easy_install dist/eggname.egg
注意根据手册 install
只不过是使用 easy_install 的快捷方式.
Note that according to the manual install
is nothing but a shortcut to easy_install use.
这篇关于使用 setuptools 仅安装 .pyc(python 编译)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!