我的目标是从 python 包创建 .deb 包并在最后分发我的 python 脚本。我对这个过程有 2 个问题
1-我可以在此处使用以下步骤创建一个 python 包。我的 setup.py 就是这样
from distutils.core import setup
setup(
# Application name:
name="MyApplication",
# Version number (initial):
version="0.1.0",
# Application author details:
author="name surname",
author_email="name@addr.ess",
# Packages
packages=["app"],
# Include additional files into the package
include_package_data=True,
# Details
url="http://pypi.python.org/pypi/MyApplication_v010/",
#
# license="LICENSE.txt",
description="Useful towel-related stuff.",
# long_description=open("README.txt").read(),
# Dependent packages (distributions)
install_requires=[
"simplejson",
"numpy",
"scikit-learn",
"scipy",
],
)
install_requires 部分的情况开始有所不同。我知道这些库可以通过 pip 安装,所以在这种情况下,我创建了 python 包并创建了包的 tar.gz。所以
python setup.py install命令不会在 install_requires 列表中安装库,但是如果我使用pip install name_of_the_package.tar.gz调用 python 包 tar.gz它会在列表中安装库。那么为什么python setup.py install命令不安装库呢?
2-然后我使用stdeb从我的 python 包创建 .deb 包。当我尝试将 .deb 包安装到我的系统时,我希望在 install_requires 列表中安装库,但它们没有安装?
我觉得我正在跳过一部分,但我不知道我在跳过什么?