How to create setup.py file in python project

Create setup.py file in python project.

We need to create a setup.py file in root directory of your project so that it will access the whole project.

Template of setup.py file.

When ever we want to create a pyspark project we have to create a executable file which can be uploaded into spark environment to run the code. To create that executable file we need a setup.py file which will be similar to pom file in java programs

It will hold the what are the libraries we need in the project.

In the script option we need to mention the main script will be called as an starting point of our project.

Find packages will ping all the packages present in the code.

from setuptools import setup, find_packages

setup(
    name="project name",
    description="Description of project",
    version='1.0',
    author="author name",
    author_email="author email id",
    url="",
    packages=find_packages(),
    scripts=["hello_world.py"],
    install_requires=[
          'boto3'
      ],
    python_requires='>=3.6')

Comments