'ez_setup.py install : ImportError: cannot import name Command

I am using Jython version 2.7.2 and I installed it using brew. And, I am using Python version 3.9.9. I want to use my python module in Jython. For doing the same, when I try jython ez_setup.py , I get the following error :

Traceback (most recent call last):
  File "ez_setup.py", line 278, in <module>
    main(sys.argv[1:])
  File "ez_setup.py", line 212, in main
    from setuptools.command.easy_install import main
  File "/Users/prachikhattar/Desktop/setuptools-0.6c11-py2.7.egg/setuptools/__init__.py", line 2, in <module>
  File "/Users/prachikhattar/Desktop/setuptools-0.6c11-py2.7.egg/setuptools/extension.py", line 2, in <module>
  File "/Users/prachikhattar/Desktop/setuptools-0.6c11-py2.7.egg/setuptools/dist.py", line 5, in <module>
  File "/opt/homebrew/Cellar/jython/2.7.2/libexec/Lib/_fix_jython_setuptools_osx.py", line 10, in <module>
    from setuptools.command import easy_install as ez
  File "/Users/prachikhattar/Desktop/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 14, in <module>
ImportError: cannot import name Command

Can anyone please tell me what's going wrong?

Any help would be highly appreciated. Thank you



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source