python 使用pip管理 打包wheel

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的文件夹)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章