1.編寫python文件,代碼文件夾管理如下
2. 編寫setup.py文件
from setuptools import setup, find_packages
setup(
name="locate_mate",
version="0.1",
keywords=("pip", "locate_mate", "featureextraction"),
description="An feature extraction algorithm",
long_description="xxx",
license="MIT Licence",
url="https://www.xxx.com",
author="xxx",
author_email="[email protected]",
packages=find_packages(),
include_package_data=True,
platforms="any",
install_requires=["numpy", "opencv-python"] # 這個項目需要的第三方庫
)
3.打包爲wheel文件
安裝wheel
pip install wheel
打包wheel
pip wheel --wheel-dir=~/wheel_dir ./
wheel-dir 爲wheel 輸出文件夾,後面接項目文件夾(即包含setup.py的文件夾)