1

Hi I am new to Python programming. I have written the following setup.py script to install the dependencies by customizing the install. But, the python packages are not installed in my virtual environment. Please help me.

from setuptools import setup, find_packages
from setuptools.command.install import install


class CustomInstallCommand(install):
    """Customized setuptools install command - prints a friendly greeting."""

    def run(self):
        print("I am trying to install ...")
        install.run(self)

# dependencies = ['configparser == 4.0.2', 'colorama == 0.4.3', 'xlsxwriter == 1.2.7']


setup(cmdclass={
        'install': CustomInstallCommand,
        },
    name='Testing',
      version='0.1',
      author='DD Mishra',
      description='PDE Integration testing',
      packages=find_packages(),
      install_requires=['configparser == 4.0.2', 'colorama == 0.4.3', 'xlsxwriter == 1.2.7']
      )

If I remove the following line from setup() function, it works fine.

cmdclass={
        'install': CustomInstallCommand,
        },

What may be the issue ? Please help me to resolve. I am trying to achieve maven or gradle type feature which we in Java, in Python.

PythonLearner
  • 1,416
  • 7
  • 22
  • 1
    What exactly works and doesn't work with and without `cmdclass`? Any error? Saw https://stackoverflow.com/q/21915469/7976758? https://stackoverflow.com/search?q=%5Bsetuptools%5D+cmdclass+install – phd Feb 18 '20 at 16:42
  • @phd, Sir, Excellent, it worked. Thank you very much. You can answer so that I can accept the answer. – PythonLearner Feb 18 '20 at 16:52

0 Answers0