Wind River Support Network

HomeDefectsLINCD-11849
Fixed

LINCD-11849 : python3 setup.py install failed

Created: Feb 22, 2023    Updated: Mar 27, 2023
Resolved Date: Mar 4, 2023
Found In Version: 10.23.9.0
Fix Version: 10.23.13.0
Severity: Standard
Applicable for: Wind River Linux CD
Component/s: Userspace

Description

~# cat > setup.py <<EOF

from setuptools import setup, find_packages

setup(
name='HelloWorld',
version='0.1',
packages=find_packages(),
)

EOF 
~# 
~# python3 setup.py sdist
running sdist
running egg_info
creating HelloWorld.egg-info
writing HelloWorld.egg-info/PKG-INFO
writing dependency_links to HelloWorld.egg-info/dependency_links.txt
writing top-level names to HelloWorld.egg-info/top_level.txt
writing manifest file 'HelloWorld.egg-info/SOURCES.txt'
reading manifest file 'HelloWorld.egg-info/SOURCES.txt'
writing manifest file 'HelloWorld.egg-info/SOURCES.txt'
warning: sdist: standard file not found: should have one of README, README.rst, README.txt, README.md

running check
creating HelloWorld-0.1
creating HelloWorld-0.1/HelloWorld.egg-info
copying files to HelloWorld-0.1...
copying setup.py -> HelloWorld-0.1
copying HelloWorld.egg-info/PKG-INFO -> HelloWorld-0.1/HelloWorld.egg-info
copying HelloWorld.egg-info/SOURCES.txt -> HelloWorld-0.1/HelloWorld.egg-info
copying HelloWorld.egg-info/dependency_links.txt -> HelloWorld-0.1/HelloWorld.egg-info
copying HelloWorld.egg-info/top_level.txt -> HelloWorld-0.1/HelloWorld.egg-info
Writing HelloWorld-0.1/setup.cfg
creating dist
Creating tar archive
removing 'HelloWorld-0.1' (and everything under it)
~#
~#
~# python3 setup.py install 
running install
/usr/lib64/python3.11/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
/usr/lib64/python3.11/site-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
Traceback (most recent call last):
  File "/root/setup.py", line 4, in <module>
    setup(
  File "/usr/lib64/python3.11/site-packages/setuptools/__init__.py", line 108, in setup
    return distutils.core.setup(**attrs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/site-packages/setuptools/_distutils/core.py", line 185, in setup
    return run_commands(dist)
           ^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
    dist.run_commands()
  File "/usr/lib64/python3.11/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
    self.run_command(cmd)
  File "/usr/lib64/python3.11/site-packages/setuptools/dist.py", line 1213, in run_command
    super().run_command(command)
  File "/usr/lib64/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/usr/lib64/python3.11/site-packages/setuptools/command/install.py", line 74, in run
    self.do_egg_install()
  File "/usr/lib64/python3.11/site-packages/setuptools/command/install.py", line 117, in do_egg_install
    cmd.ensure_finalized()  # finalize before bdist_egg munges install cmd
    ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/site-packages/setuptools/_distutils/cmd.py", line 111, in ensure_finalized
    self.finalize_options()
  File "/usr/lib64/python3.11/site-packages/setuptools/command/easy_install.py", line 311, in finalize_options
    self.local_index = Environment(self.shadow_path + sys.path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/site-packages/pkg_resources/__init__.py", line 1044, in __init__
    self.scan(search_path)
  File "/usr/lib64/python3.11/site-packages/pkg_resources/__init__.py", line 1077, in scan
    self.add(dist)
  File "/usr/lib64/python3.11/site-packages/pkg_resources/__init__.py", line 1096, in add
    dists.sort(key=operator.attrgetter('hashcmp'), reverse=True)
  File "/usr/lib64/python3.11/site-packages/pkg_resources/__init__.py", line 2631, in hashcmp
    self.parsed_version,
    ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/site-packages/pkg_resources/__init__.py", line 2679, in parsed_version
    self._parsed_version = parse_version(self.version)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/site-packages/pkg_resources/_vendor/packaging/version.py", line 197, in __init__
    raise InvalidVersion(f"Invalid version: '{version}'")
pkg_resources.extern.packaging.version.InvalidVersion: Invalid version: '1.18.0-unknown'
(package: gpg)
~# 
~# python3
Python 3.11.1 (main, Dec  6 2022, 19:20:21) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import setuptools
>>> print(setuptools.__version__)
67.2.0

Steps to Reproduce

1. setup.sh
--machine xilinx-zynqmp --dl-layers=1 --distro wrlinux --templates feature/package-management --dl-layers=1

2. . ./environment-setup-<host>-wrlinuxsdk-linux
 . ./oe-init-build-env

3. modify conf/local.conf
   IMAGE_INSTALL:append = " python3 python3-setuptools libpython3-staticdev"

4. bitbake wrlinux-image-std 
Live chat
Online