#60669 closed defect (fixed)

libiio: ModuleNotFoundError: No module named 'setuptools'

Reported by: ryandesign (Ryan Schmidt) Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version: 2.6.2
Keywords: Cc:
Port: libiio

Description

libiio fails to build:

Traceback (most recent call last):
  File "/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_libiio/libiio/work/build/bindings/python/setup.py", line 24, in <module>
    from setuptools import setup
ModuleNotFoundError: No module named 'setuptools'
make[2]: *** [bindings/python/CMakeFiles/libiio-py] Error 1

Probably the port needs a dependency on py##-setuptools?

Change History (7)

comment:1 Changed 16 months ago by ryandesign (Ryan Schmidt)

comment:2 Changed 16 months ago by ryandesign (Ryan Schmidt)

If I add the dependency on py##-setuptools, the build succeeds but destroot fails:

running install
Traceback (most recent call last):
  File "/opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-svn-trunk-new_science_libiio/libiio/work/build/bindings/python/setup.py", line 60, in _check_libiio_installed
    raise OSError
OSError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-svn-trunk-new_science_libiio/libiio/work/build/bindings/python/setup.py", line 89, in <module>
    setup(**config)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/__init__.py", line 161, in setup
    return distutils.core.setup(**attrs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-svn-trunk-new_science_libiio/libiio/work/build/bindings/python/setup.py", line 43, in run
    self._check_libiio_installed()
  File "/opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-svn-trunk-new_science_libiio/libiio/work/build/bindings/python/setup.py", line 66, in _check_libiio_installed
    raise Exception(msg)
Exception: The libiio library could not be found.
            libiio needs to be installed first before the python bindings.
            The latest release can be found on GitHub:
            https://github.com/analogdevicesinc/libiio/releases
make: Leaving directory `/opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-svn-trunk-new_science_libiio/libiio/work/build'
DEBUG: Executing proc-post-org.macports.destroot-destroot-0
xinstall: mkdir /opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-svn-trunk-new_science_libiio/libiio/work/destroot/opt/local/Library/Frameworks/Python.framework
xinstall: mkdir /opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-svn-trunk-new_science_libiio/libiio/work/destroot/opt/local/Library/Frameworks/Python.framework/Versions
xinstall: mkdir /opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-svn-trunk-new_science_libiio/libiio/work/destroot/opt/local/Library/Frameworks/Python.framework/Versions/3.7
xinstall: mkdir /opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-svn-trunk-new_science_libiio/libiio/work/destroot/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib
Error: Failed to destroot libiio: error renaming "/opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-svn-trunk-new_science_libiio/libiio/work/destroot/opt/local/lib/python3.7": no such file or directory

Sounds like libiio's python support should be in a separate py-libiio port rather than variants in the libiio port?

comment:3 Changed 16 months ago by ryandesign (Ryan Schmidt)

Michael, do you agree with this course of action?

Right now everything that depends on libiio is failing on the buildbot because libiio cannot be built.

Step 1 could be to remove the python support from libiio so that it can build.

Step 2 could be to introduce a py-libiio port.

comment:4 Changed 15 months ago by michaelld (Michael Dickens)

hmmm ... I don't see this on 10.14 ... when I'm in at work tomorrow I have 10.12 booted for the recent GR work & I'll see if I can replicate the issue there.

comment:5 Changed 15 months ago by ryandesign (Ryan Schmidt)

You should see it on any system, provided libiio is not already installed or you use trace mode.

You can see at https://ports.macports.org/port/libiio/summary that it doesn't build anywhere.

comment:6 Changed 15 months ago by michaelld (Michael Dickens)

Ah; OK that was the key: not already installed. Yes, now I see it too. Let me look into this.

comment:7 Changed 15 months ago by michaelld (Michael Dickens)

Resolution: fixed
Status: assignedclosed

In 5f7c3ad3911fb416f561487142524a643b0694ff/macports-ports (master):

libiio: add patch to disable checking for libiio during install

Closes: #60669

Note: See TracTickets for help on using tickets.