Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

setuptools.installer and fetch_build_eggs are deprecated. Requirements should be satisfied by a PEP 517 installer

I was trying to setup this repository locally. I run the python setup.py install command to setup the library. The contents of the setup.py file is as follows:

...
setuptools.setup(
    # Meta-data
    name="GraspDetSeg_CNN",
    author="Stefan Ainetter",
    author_email="[email protected]",
    description="Grasp Detection and Segmentation for Pytorch, code based on Seamless Scene Segmentation (https://github.com/mapillary/seamseg).",
    long_description_content_type="text/markdown",
    url="",
    classifiers=[
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.4",
        "Programming Language :: Python :: 3.5",
        "Programming Language :: Python :: 3.6",
        "Programming Language :: Python :: 3.7",
    ],

    # Versioning
    use_scm_version={"root": ".", "relative_to": __file__, "write_to": "grasp_det_seg/_version.py"},

    # Requirements
    setup_requires=["setuptools_scm"],
    python_requires=">=3, <4",

    # Package description
    packages=[
        "grasp_det_seg",
        "grasp_det_seg.algos",
        "grasp_det_seg.config",
        "grasp_det_seg.data_OCID",
        "grasp_det_seg.models",
        "grasp_det_seg.modules",
        "grasp_det_seg.modules.heads",
        "grasp_det_seg.utils",
        "grasp_det_seg.utils.bbx",
        "grasp_det_seg.utils.nms",
        "grasp_det_seg.utils.parallel",
        "grasp_det_seg.utils.roi_sampling",
    ],
    ext_modules=[
        make_extension("nms", "grasp_det_seg.utils"),
        make_extension("bbx", "grasp_det_seg.utils"),
        make_extension("roi_sampling", "grasp_det_seg.utils")
    ],
    cmdclass={"build_ext": BuildExtension},
    include_package_data=True,
)

I guess this tries to install another dependency named GraspDetSeg_CNN with the link https://github.com/mapillary/seamseg. After running the command python setup.py install I am getting the following error. The error is too long so I am cutting some portions that I think are not related.

home/ozaland/anaconda3/envs/fedgrasp/lib/python3.7/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 install
/home/ozaland/anaconda3/envs/fedgrasp/lib/python3.7/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 or other
        standards-based tools.

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

!!
  self.initialize_options()
/home/ozaland/anaconda3/envs/fedgrasp/lib/python3.7/site-packages/setuptools/_distutils/cmd.py:66: EasyInstallDeprecationWarning: easy_install command is deprecated.
!!

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

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

!!
  self.initialize_options()
running bdist_egg
running egg_info
writing GraspDetSeg_CNN.egg-info/PKG-INFO
writing dependency_links to GraspDetSeg_CNN.egg-info/dependency_links.txt
writing top-level names to GraspDetSeg_CNN.egg-info/top_level.txt
adding license file 'LICENSE'
writing manifest file 'GraspDetSeg_CNN.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
copying grasp_det_seg/_version.py -> build/lib.linux-x86_64-cpython-37/grasp_det_seg
/home/ozaland/anaconda3/envs/fedgrasp/lib/python3.7/site-packages/setuptools/command/build_py.py:201: _Warning: Package 'grasp_det_seg.__pycache__' is absent from the `packages` configuration.
!!

        ********************************************************************************
        ############################
        # Package would be ignored #
        ############################
        Python recognizes 'grasp_det_seg.__pycache__' as an importable package[^1],
        but it is absent from setuptools' `packages` configuration.

        This leads to an ambiguous overall configuration. If you want to distribute this
        package, please make sure that 'grasp_det_seg.__pycache__' is explicitly added
        to the `packages` configuration field.

        Alternatively, you can also rely on setuptools' discovery methods
        (for example by using `find_namespace_packages(...)`/`find_namespace:`
        instead of `find_packages(...)`/`find:`).

        You can read more about "package discovery" on setuptools documentation page:

        - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

        If you don't want 'grasp_det_seg.__pycache__' to be distributed and are
        already explicitly excluding 'grasp_det_seg.__pycache__' via
        `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
        you can try to use `exclude_package_data`, or `include-package-data=False` in
        combination with a more fine grained `package-data` configuration.

        You can read more about "package data files" on setuptools documentation page:

        - https://setuptools.pypa.io/en/latest/userguide/datafiles.html


        [^1]: For Python, any directory (with suitable naming) can be imported,
              even if it does not contain any `.py` files.
              On the other hand, currently there is no concept of package data
              directory, all directories are treated like packages.
        ********************************************************************************

!!
 
  check.warn(importable)
running build_ext
copying build/lib.linux-x86_64-cpython-37/grasp_det_seg/_version.py -> build/bdist.linux-x86_64/egg/grasp_det_seg
byte-compiling build/bdist.linux-x86_64/egg/grasp_det_seg/_version.py to _version.cpython-37.pyc
creating stub loader for grasp_det_seg/utils/nms/_backend.cpython-37m-x86_64-linux-gnu.so
creating stub loader for grasp_det_seg/utils/bbx/_backend.cpython-37m-x86_64-linux-gnu.so
creating stub loader for grasp_det_seg/utils/roi_sampling/_backend.cpython-37m-x86_64-linux-gnu.so
byte-compiling build/bdist.linux-x86_64/egg/grasp_det_seg/utils/nms/_backend.py to _backend.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/grasp_det_seg/utils/bbx/_backend.py to _backend.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/grasp_det_seg/utils/roi_sampling/_backend.py to _backend.cpython-37.pyc
copying GraspDetSeg_CNN.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying GraspDetSeg_CNN.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying GraspDetSeg_CNN.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying GraspDetSeg_CNN.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
writing build/bdist.linux-x86_64/egg/EGG-INFO/native_libs.txt
zip_safe flag not set; analyzing archive contents...
Traceback (most recent call last):
  File "setup.py", line 77, in <module>
    include_package_data=True,
  File "/home/ozaland/anaconda3/envs/fedgrasp/lib/python3.7/site-packages/setuptools/__init__.py", line 107, in setup
    return distutils.core.setup(**attrs)
  File "/home/ozaland/anaconda3/envs/fedgrasp/lib/python3.7/site-packages/setuptools/_distutils/core.py", line 185, in setup
    return run_commands(dist)
  File "/home/ozaland/anaconda3/envs/fedgrasp/lib/python3.7/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
    dist.run_commands()
  File "/home/ozaland/anaconda3/envs/fedgrasp/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
    self.run_command(cmd)
  File "/home/ozaland/anaconda3/envs/fedgrasp/lib/python3.7/site-packages/setuptools/dist.py", line 1234, in run_command
    super().run_command(command)
  File "/home/ozaland/anaconda3/envs/fedgrasp/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/home/ozaland/anaconda3/envs/fedgrasp/lib/python3.7/site-packages/setuptools/command/install.py", line 80, in run
    self.do_egg_install()
  File "/home/ozaland/anaconda3/envs/fedgrasp/lib/python3.7/site-packages/setuptools/command/install.py", line 129, in do_egg_install
    self.run_command('bdist_egg')
  File "/home/ozaland/anaconda3/envs/fedgrasp/lib/python3.7/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
    self.distribution.run_command(command)
  File "/home/ozaland/anaconda3/envs/fedgrasp/lib/python3.7/site-packages/setuptools/dist.py", line 1234, in run_command
    super().run_command(command)
  File "/home/ozaland/anaconda3/envs/fedgrasp/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/home/ozaland/anaconda3/envs/fedgrasp/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 212, in run
    os.path.join(archive_root, 'EGG-INFO'), self.zip_safe()
  File "/home/ozaland/anaconda3/envs/fedgrasp/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 265, in zip_safe
    return analyze_egg(self.bdist_dir, self.stubs)
  File "/home/ozaland/anaconda3/envs/fedgrasp/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 339, in analyze_egg
    safe = scan_module(egg_dir, base, name, stubs) and safe
  File "/home/ozaland/anaconda3/envs/fedgrasp/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 376, in scan_module
    code = marshal.load(f)
ValueError: bad marshal data (unknown type code)

All the packages that are in the packages list in the setup.py file are ignored. The erro portion contains only one such instance.

The following are the environment details: Ubuntu 22.04 CUDA 10.1 GCC version 8 Python 3.7 with Anaconda torch==1.1.0 torchvision==0.3.0

The requirements are as of the requirement file in the repository.

I did the following things:

  • Reinstall and upgrade setuptools
  • Manually install the github repository through pip and --use-pep517 flag

None of the above has worked.

like image 470
Obaidullah Zaland Avatar asked Sep 16 '25 05:09

Obaidullah Zaland


1 Answers

most solutions I have seen so far seem to revolve around downgrading to a previous version : setuptools==58.2.0

It worked for me so far..

I would be glad to know if you found something better.

See also : This stackoverflow post

like image 162
DooM3P Avatar answered Sep 19 '25 09:09

DooM3P