WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: python-setuptools.tcz issue to build Ansible  (Read 3012 times)

Offline rhermsen

  • Wiki Author
  • Full Member
  • *****
  • Posts: 109
python-setuptools.tcz issue to build Ansible
« on: September 13, 2020, 11:19:32 AM »
I’m having an issue with python-setuptools.tcz to build ansible.
I ran into this also with the previous available version 41.0.1 and now also with 45.2.0.
I found a workaround by installing setuptools manually.

Error I get:
Code: [Select]
$ python setup.py build
Ansible now needs setuptools in order to build. Install it using your package manager (usually python-setuptools) or via pip (pip install setuptools).

The part in the ansible code that looks to be involved:
Code: [Select]
try:                                                                               
    from setuptools import setup, find_packages                                     
    from setuptools.command.build_py import build_py as BuildPy             
    from setuptools.command.install_lib import install_lib as InstallLib     
    from setuptools.command.install_scripts import install_scripts as InstallScripts
except ImportError:                               
    print("Ansible now needs setuptools in order to build. Install it using"
          " your package manager (usually python-setuptools) or via pip (pip"
          " install setuptools).", file=sys.stderr)
    sys.exit(1)

If I comment out the exit line I see the following:
Code: [Select]
$ python setup.py build
Ansible now needs setuptools in order to build. Install it using your package manager (usually python-setuptools) or via pip (pip install setuptools).
Traceback (most recent call last):
  File "setup.py", line 104, in <module>
    class BuildPyCommand(BuildPy):
NameError: name 'BuildPy' is not defined

If I install setuptools using the following steps it works fine with ansilbe:
Code: [Select]
cd /tmp
mkdir setuptools
cd /tmp/setuptools
wget https://files.pythonhosted.org/packages/68/75/d1d7b7340b9eb6e0388bf95729e63c410b381eb71fe8875cdfd949d8f9ce/setuptools-45.2.0.zip
unzip setuptools-45.2.0.zip
cd /tmp/setuptools/setuptools-45.2.0
python setup.py build
sudo python setup.py install


Offline Sashank999

  • Sr. Member
  • ****
  • Posts: 405
Re: python-setuptools.tcz issue to build Ansible
« Reply #1 on: September 14, 2020, 02:44:09 AM »
Are you sure that you have python3.6-setuptools.tcz installed ?

Offline rhermsen

  • Wiki Author
  • Full Member
  • *****
  • Posts: 109
Re: python-setuptools.tcz issue to build Ansible
« Reply #2 on: September 14, 2020, 04:59:12 AM »
I haven't moved on yet, still with Python-2.7...

Offline Sashank999

  • Sr. Member
  • ****
  • Posts: 405
Re: python-setuptools.tcz issue to build Ansible
« Reply #3 on: September 14, 2020, 06:59:30 AM »
I would personally suggest python3.
Do you have python-setuptools.tcz ?

I am on x64 repo. I don't know if you are on 32 bit one. Please also say the architecture and the TC version you are on (find it with the "version" command).
« Last Edit: September 14, 2020, 07:11:20 AM by Sashank999 »

Offline rhermsen

  • Wiki Author
  • Full Member
  • *****
  • Posts: 109
Re: python-setuptools.tcz issue to build Ansible
« Reply #4 on: September 14, 2020, 10:20:09 AM »
Oops yes, that is missing.
arch = 32bit
TC version = 11.0

python-setuptools.tcz is indeed what I had installed.

When I first created the extension for Ansible it was advised to use Python2.

Offline Sashank999

  • Sr. Member
  • ****
  • Posts: 405
Re: python-setuptools.tcz issue to build Ansible
« Reply #5 on: September 14, 2020, 10:44:57 PM »
Is the issue solved ?

If yes, ask Rich to mark as solved.

Offline rhermsen

  • Wiki Author
  • Full Member
  • *****
  • Posts: 109
Re: python-setuptools.tcz issue to build Ansible
« Reply #6 on: September 15, 2020, 05:56:36 PM »
Hi, Yes just found the reason to be a missing dependency.

I think extension 'python-cffi.tcz' is missing 'libffi.tcz' as dependency.