Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to install on Python 3.12 #147

Open
dmradcilff opened this issue Dec 13, 2023 · 4 comments
Open

Failure to install on Python 3.12 #147

dmradcilff opened this issue Dec 13, 2023 · 4 comments

Comments

@dmradcilff
Copy link

I am trying install onnxoptimizer either through pip install onnxoptimizer or directly from source. Either way I get the same failures. I am running Fedora 39 and python 3.12.0.

$ pip3 install -e .
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://gpm.some-anonymous-host.com/pypi/PyPI/simple, https://pypi.org/simple, https://pypi.ngc.nvidia.com
Obtaining file:///home/user/projects/AI_Development/brevitas/onnxoptimizer
Preparing metadata (setup.py) ... done
Requirement already satisfied: onnx in /home/user/.local/lib/python3.12/site-packages (from onnxoptimizer==0.3.17) (1.15.0)
Requirement already satisfied: numpy in /home/user/.local/lib/python3.12/site-packages (from onnx->onnxoptimizer==0.3.17) (1.26.2)
Requirement already satisfied: protobuf>=3.20.2 in /home/user/.local/lib/python3.12/site-packages (from onnx->onnxoptimizer==0.3.17) (4.23.4)
Installing collected packages: onnxoptimizer
Running setup.py develop for onnxoptimizer
error: subprocess-exited-with-error

× python setup.py develop did not run successfully.
│ exit code: 1
╰─> [110 lines of output]
    /usr/lib/python3.12/site-packages/setuptools/dist.py:755: SetuptoolsDeprecationWarning: Invalid dash-separated options
    !!
    
            ********************************************************************************
            Usage of dash-separated 'license-file' will not be supported in future
            versions. Please use the underscore name 'license_file' instead.
    
            This deprecation is overdue, please update your project and remove deprecated
            calls to avoid build errors in the future.
    
            See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
            ********************************************************************************
    
    !!
      opt = self.warn_dash_deprecation(opt, section)
    /usr/lib/python3.12/site-packages/setuptools/config/setupcfg.py:293: _DeprecatedConfig: Deprecated config in `setup.cfg`
    !!
    
            ********************************************************************************
            The license_file parameter is deprecated, use license_files instead.
    
            This deprecation is overdue, please update your project and remove deprecated
            calls to avoid build errors in the future.
    
            See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
            ********************************************************************************
    
    !!
      parsed = self.parsers.get(option_name, lambda x: x)(value)
    /usr/lib/python3.12/site-packages/setuptools/__init__.py:84: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
    !!
    
            ********************************************************************************
            Requirements should be satisfied by a PEP 517 installer.
            If you are using pip, you can try `pip install --use-pep517`.
            ********************************************************************************
    
    !!
      dist.fetch_build_eggs(dist.setup_requires)
    running develop
    /usr/lib/python3.12/site-packages/setuptools/command/develop.py:40: EasyInstallDeprecationWarning: easy_install command is deprecated.
    !!
    
            ********************************************************************************
            Please avoid running ``setup.py`` and ``easy_install``.
            Instead, use pypa/build, pypa/installer, pypa/build or
            other standards-based tools.
    
            See https://github.com/pypa/setuptools/issues/917 for details.
            ********************************************************************************
    
    !!
      easy_install.initialize_options(self)
    /usr/lib/python3.12/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
    !!
    
            ********************************************************************************
            Please avoid running ``setup.py`` directly.
            Instead, use pypa/build, pypa/installer, pypa/build or
            other standards-based tools.
    
            See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
            ********************************************************************************
    
    !!
      self.initialize_options()
    running build_py
    running create_version
    running cmake_build
    /opt/Xilinx//Vitis/2022.2/tps/lnx64/cmake-3.3.2/bin/cmake: error while loading shared libraries: libidn.so.11: cannot open shared object file: No such file or directory
    Traceback (most recent call last):
      File "<string>", line 2, in <module>
      File "<pip-setuptools-caller>", line 34, in <module>
      File "/home/user/projects/AI_Development/brevitas/onnxoptimizer/setup.py", line 327, in <module>
        setuptools.setup(
      File "/usr/lib/python3.12/site-packages/setuptools/__init__.py", line 107, in setup
        return distutils.core.setup(**attrs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 185, in setup
        return run_commands(dist)
               ^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
        dist.run_commands()
      File "/usr/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python3.12/site-packages/setuptools/dist.py", line 1244, in run_command
        super().run_command(command)
      File "/usr/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
        cmd_obj.run()
      File "/home/user/projects/AI_Development/brevitas/onnxoptimizer/setup.py", line 239, in run
        self.run_command('build_py')
      File "/usr/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python3.12/site-packages/setuptools/dist.py", line 1244, in run_command
        super().run_command(command)
      File "/usr/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
        cmd_obj.run()
      File "/home/user/projects/AI_Development/brevitas/onnxoptimizer/setup.py", line 223, in run
        self.run_command('cmake_build')
      File "/usr/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python3.12/site-packages/setuptools/dist.py", line 1244, in run_command
        super().run_command(command)
      File "/usr/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
        cmd_obj.run()
      File "/home/user/projects/AI_Development/brevitas/onnxoptimizer/setup.py", line 209, in run
        subprocess.check_call(cmake_args)
      File "/usr/lib64/python3.12/subprocess.py", line 413, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['/opt/Xilinx//Vitis/2022.2/tps/lnx64/cmake-3.3.2/bin/cmake', '-DPython_INCLUDE_DIR=/usr/include/python3.12', '-DPython_EXECUTABLE=/usr/bin/python', '-DBUILD_ONNX_PYTHON=ON', '-DONNX_USE_LITE_PROTO=ON', '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON', '-DONNX_NAMESPACE=onnx', '-DPY_EXT_SUFFIX=.cpython-312-x86_64-linux-gnu.so', '-DONNX_OPT_USE_SYSTEM_PROTOBUF=OFF', '-DCMAKE_BUILD_TYPE=Release', '-DONNX_ML=1', '/home/user/projects/AI_Development/brevitas/onnxoptimizer']' returned non-zero exit status 127.
    [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.

error: subprocess-exited-with-error

× python setup.py develop did not run successfully.
│ exit code: 1
╰─> [110 lines of output]
/usr/lib/python3.12/site-packages/setuptools/dist.py:755: SetuptoolsDeprecationWarning: Invalid dash-separated options
!!

        ********************************************************************************
        Usage of dash-separated 'license-file' will not be supported in future
        versions. Please use the underscore name 'license_file' instead.

        This deprecation is overdue, please update your project and remove deprecated
        calls to avoid build errors in the future.

        See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
        ********************************************************************************

!!
  opt = self.warn_dash_deprecation(opt, section)
/usr/lib/python3.12/site-packages/setuptools/config/setupcfg.py:293: _DeprecatedConfig: Deprecated config in `setup.cfg`
!!

        ********************************************************************************
        The license_file parameter is deprecated, use license_files instead.

        This deprecation is overdue, please update your project and remove deprecated
        calls to avoid build errors in the future.

        See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
        ********************************************************************************

!!
  parsed = self.parsers.get(option_name, lambda x: x)(value)
/usr/lib/python3.12/site-packages/setuptools/__init__.py:84: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
!!

        ********************************************************************************
        Requirements should be satisfied by a PEP 517 installer.
        If you are using pip, you can try `pip install --use-pep517`.
        ********************************************************************************

!!
  dist.fetch_build_eggs(dist.setup_requires)
running develop
/usr/lib/python3.12/site-packages/setuptools/command/develop.py:40: EasyInstallDeprecationWarning: easy_install command is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` and ``easy_install``.
        Instead, use pypa/build, pypa/installer, pypa/build or
        other standards-based tools.

        See https://github.com/pypa/setuptools/issues/917 for details.
        ********************************************************************************

!!
  easy_install.initialize_options(self)
/usr/lib/python3.12/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` directly.
        Instead, use pypa/build, pypa/installer, pypa/build or
        other standards-based tools.

        See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
        ********************************************************************************

!!
  self.initialize_options()
running build_py
running create_version
running cmake_build
/opt/Xilinx//Vitis/2022.2/tps/lnx64/cmake-3.3.2/bin/cmake: error while loading shared libraries: libidn.so.11: cannot open shared object file: No such file or directory
Traceback (most recent call last):
  File "<string>", line 2, in <module>
  File "<pip-setuptools-caller>", line 34, in <module>
  File "/home/user/projects/AI_Development/brevitas/onnxoptimizer/setup.py", line 327, in <module>
    setuptools.setup(
  File "/usr/lib/python3.12/site-packages/setuptools/__init__.py", line 107, in setup
    return distutils.core.setup(**attrs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 185, in setup
    return run_commands(dist)
           ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
    dist.run_commands()
  File "/usr/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.12/site-packages/setuptools/dist.py", line 1244, in run_command
    super().run_command(command)
  File "/usr/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/home/user/projects/AI_Development/brevitas/onnxoptimizer/setup.py", line 239, in run
    self.run_command('build_py')
  File "/usr/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.12/site-packages/setuptools/dist.py", line 1244, in run_command
    super().run_command(command)
  File "/usr/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/home/user/projects/AI_Development/brevitas/onnxoptimizer/setup.py", line 223, in run
    self.run_command('cmake_build')
  File "/usr/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.12/site-packages/setuptools/dist.py", line 1244, in run_command
    super().run_command(command)
  File "/usr/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/home/user/projects/AI_Development/brevitas/onnxoptimizer/setup.py", line 209, in run
    subprocess.check_call(cmake_args)
  File "/usr/lib64/python3.12/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/Xilinx//Vitis/2022.2/tps/lnx64/cmake-3.3.2/bin/cmake', '-DPython_INCLUDE_DIR=/usr/include/python3.12', '-DPython_EXECUTABLE=/usr/bin/python', '-DBUILD_ONNX_PYTHON=ON', '-DONNX_USE_LITE_PROTO=ON', '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON', '-DONNX_NAMESPACE=onnx', '-DPY_EXT_SUFFIX=.cpython-312-x86_64-linux-gnu.so', '-DONNX_OPT_USE_SYSTEM_PROTOBUF=OFF', '-DCMAKE_BUILD_TYPE=Release', '-DONNX_ML=1', '/home/user/projects/AI_Development/brevitas/onnxoptimizer']' returned non-zero exit status 127.
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.

@FdyCN
Copy link

FdyCN commented Feb 27, 2024

i got the same error on python 3.8.18 and 3.11.5 both. : (

@yan12125
Copy link

yan12125 commented Mar 1, 2024

/opt/Xilinx//Vitis/2022.2/tps/lnx64/cmake-3.3.2/bin/cmake: error while loading shared libraries: libidn.so.11: cannot open shared object file: No such file or directory

It seems pip uses Xilinx's cmake, which is not compatible with your system yet. I can install onnxoptimizer on Arch Linux after installing gcc and cmake from Arch Linux repositories.

Anyway, it will be better if the developer can provide a wheel for Python 3.12.

@ogencoglu
Copy link

Same issue here. Any updates?

@Prurite
Copy link

Prurite commented Oct 23, 2024

Compilation failed for python 3.12 for a variety of errors. Hope there's a wheel for python 3.12.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants