python3 setup.py bdist --format=rpm

Bug #1475293 reported by Hassan Nael
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
bobo
New
Undecided
Unassigned

Bug Description

Hi,

reading the instructions on https://docs.python.org/3.2/distutils/builtdist.html, it would appear that you can build an rpm for python version 3 for Linux. I have setup an lxc container on my ubuntu 15.04 running Centos 5.11 (Target servers are running redhat 5). when running /usr/local/bin/python3 setup.py bdist --format=rpm or bdist_rpm I get the below error message.

Looking at setup.py is not python3 so I tried to do 2to3 -w setup.py and I have gone further because the original error was (with open(_BUILDDIR_COOKIE, "wb") as f:
            ^
)

writing 'build/bdist.linux-x86_64/rpm/SPECS/Python.spec'
running sdist
running check
warning: sdist: manifest template 'MANIFEST.in' does not exist (using default file list)

writing manifest file 'MANIFEST'
making hard links in Python-3.2.6...
'_struct.c' not a regular file -- skipping
hard linking setup.py.bak -> Python-3.2.6
Creating tar archive
Traceback (most recent call last):
  File "/usr/local/lib/python3.2/tarfile.py", line 419, in __init__
    import zlib
ImportError: No module named zlib

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "setup.py.bak", line 1944, in <module>
    main()
  File "setup.py.bak", line 1939, in main
    "Tools/scripts/2to3"]
  File "/usr/local/lib/python3.2/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/local/lib/python3.2/distutils/dist.py", line 917, in run_commands
    self.run_command(cmd)
  File "/usr/local/lib/python3.2/distutils/dist.py", line 936, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python3.2/distutils/command/bdist.py", line 130, in run
    self.run_command(cmd_name)
  File "/usr/local/lib/python3.2/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/local/lib/python3.2/distutils/dist.py", line 936, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python3.2/distutils/command/bdist_rpm.py", line 296, in run
    self.run_command('sdist')
  File "/usr/local/lib/python3.2/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/local/lib/python3.2/distutils/dist.py", line 936, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python3.2/distutils/command/sdist.py", line 160, in run
    self.make_distribution()
  File "/usr/local/lib/python3.2/distutils/command/sdist.py", line 447, in make_distribution
    file = self.make_archive(base_name, fmt, base_dir=base_dir)
  File "/usr/local/lib/python3.2/distutils/cmd.py", line 370, in make_archive
    dry_run=self.dry_run)
  File "/usr/local/lib/python3.2/distutils/archive_util.py", line 178, in make_archive
    filename = func(base_name, base_dir, **kwargs)
  File "/usr/local/lib/python3.2/distutils/archive_util.py", line 52, in make_tarball
    tar = tarfile.open(archive_name, 'w|%s' % tar_compression[compress])
  File "/usr/local/lib/python3.2/tarfile.py", line 1769, in open
    stream = _Stream(name, filemode, comptype, fileobj, bufsize)
  File "/usr/local/lib/python3.2/tarfile.py", line 421, in __init__
    raise CompressionError("zlib module is not available")
tarfile.CompressionError: zlib module is not available

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.