2

I have been trying to build .deb packages for Debian from Python modules. After going through Debian's LibraryStyleGuide for Python, Pybuild and An Overview of Packaging for Python, I decided I am better off with something that streamlines the process for me. I found stdeb to be a popular choice. I tried building stdeb with itself according to this. Its giving me the following error:

python3 setup.py --command-packages=stdeb.command bdist_deb

running bdist_deb
running sdist_dsc
running sdist
running check
reading manifest template 'MANIFEST.in'
writing manifest file 'MANIFEST'
creating stdeb-0.10.0
creating stdeb-0.10.0/scripts
creating stdeb-0.10.0/stdeb
creating stdeb-0.10.0/stdeb/command
creating stdeb-0.10.0/test_data
creating stdeb-0.10.0/test_data/py2_only_pkg
creating stdeb-0.10.0/test_data/py2_only_pkg/py2_only_pkg
creating stdeb-0.10.0/test_data/py3_only_pkg
creating stdeb-0.10.0/test_data/py3_only_pkg/py3_only_pkg
creating stdeb-0.10.0/test_data/simple_pkg
creating stdeb-0.10.0/test_data/simple_pkg/simple_pkg
making hard links in stdeb-0.10.0...
hard linking .gitignore -> stdeb-0.10.0
hard linking .travis.yml -> stdeb-0.10.0
hard linking CHANGELOG.txt -> stdeb-0.10.0
hard linking LICENSE.txt -> stdeb-0.10.0
hard linking MANIFEST.in -> stdeb-0.10.0
hard linking README.rst -> stdeb-0.10.0
hard linking RELEASE_NOTES.txt -> stdeb-0.10.0
hard linking Vagrantfile.debian-7-wheezy.rb -> stdeb-0.10.0
hard linking Vagrantfile.debian-8-jessie.rb -> stdeb-0.10.0
hard linking Vagrantfile.ubuntu-12.04-precise.rb -> stdeb-0.10.0
hard linking Vagrantfile.ubuntu-14.04-trusty.rb -> stdeb-0.10.0
hard linking error.txt -> stdeb-0.10.0
hard linking setup.py -> stdeb-0.10.0
hard linking stdeb.cfg -> stdeb-0.10.0
hard linking test-pypi-install.sh -> stdeb-0.10.0
hard linking test.sh -> stdeb-0.10.0
hard linking test2and3.sh -> stdeb-0.10.0
hard linking scripts/py2dsc -> stdeb-0.10.0/scripts
hard linking scripts/py2dsc-deb -> stdeb-0.10.0/scripts
hard linking scripts/pypi-download -> stdeb-0.10.0/scripts
hard linking scripts/pypi-install -> stdeb-0.10.0/scripts
hard linking stdeb/__init__.py -> stdeb-0.10.0/stdeb
hard linking stdeb/cli_runner.py -> stdeb-0.10.0/stdeb
hard linking stdeb/downloader.py -> stdeb-0.10.0/stdeb
hard linking stdeb/transport.py -> stdeb-0.10.0/stdeb
hard linking stdeb/util.py -> stdeb-0.10.0/stdeb
hard linking stdeb/command/__init__.py -> stdeb-0.10.0/stdeb/command
hard linking stdeb/command/bdist_deb.py -> stdeb-0.10.0/stdeb/command
hard linking stdeb/command/common.py -> stdeb-0.10.0/stdeb/command
hard linking stdeb/command/debianize.py -> stdeb-0.10.0/stdeb/command
hard linking stdeb/command/install_deb.py -> stdeb-0.10.0/stdeb/command
hard linking stdeb/command/sdist_dsc.py -> stdeb-0.10.0/stdeb/command
hard linking test_data/py2_only_pkg/setup.py -> stdeb-0.10.0/test_data/py2_only_pkg
hard linking test_data/py2_only_pkg/py2_only_pkg/__init__.py -> stdeb-0.10.0/test_data/py2_only_pkg/py2_only_pkg
hard linking test_data/py2_only_pkg/py2_only_pkg/py2_module.py -> stdeb-0.10.0/test_data/py2_only_pkg/py2_only_pkg
hard linking test_data/py3_only_pkg/setup.py -> stdeb-0.10.0/test_data/py3_only_pkg
hard linking test_data/py3_only_pkg/py3_only_pkg/py3_module.py -> stdeb-0.10.0/test_data/py3_only_pkg/py3_only_pkg
hard linking test_data/simple_pkg/setup.py -> stdeb-0.10.0/test_data/simple_pkg
hard linking test_data/simple_pkg/simple_pkg/__init__.py -> stdeb-0.10.0/test_data/simple_pkg/simple_pkg
Creating tar archive
removing 'stdeb-0.10.0' (and everything under it)
dpkg-buildpackage: info: source package stdeb
dpkg-buildpackage: info: source version 0.10.0-1
dpkg-buildpackage: info: source distribution unstable
dpkg-buildpackage: info: source changed by Andrew Straw <[email protected]>
 dpkg-source --before-build .
dpkg-source: info: using options from stdeb-0.10.0/debian/source/options: --extend-diff-ignore=\.egg-info$
 fakeroot debian/rules clean
dh clean --with python3 --buildsystem=python_distutils
dh: warning: Compatibility levels before 10 are deprecated (level 9 in use)
dh: error: unable to load addon python3: Cant locate Debian/Debhelper/Sequence/python3.pm in @INC (you may need to install the Debian::Debhelper::Sequence::python3 module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.32.1 /usr/local/share/perl/5.32.1 /usr/lib/x86_64-linux-gnu/perl5/5.32 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.32 /usr/share/perl/5.32 /usr/local/lib/site_perl) at (eval 16) line 1.
BEGIN failed--compilation aborted at (eval 16) line 1.

make: *** [debian/rules:7: clean] Error 25
dpkg-buildpackage: error: fakeroot debian/rules clean subprocess returned exit status 2
Traceback (most recent call last):
  File "/home/user0/Documents/temp/pac/stdeb-release-0.10.0/setup.py", line 8, in <module>
    setup(
  File "/usr/lib/python3.9/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.9/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.9/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/home/user0/Documents/temp/pac/stdeb-release-0.10.0/stdeb/command/bdist_deb.py", line 34, in run
    self.run_command('sdist_dsc')
  File "/usr/lib/python3.9/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.9/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/home/user0/Documents/temp/pac/stdeb-release-0.10.0/stdeb/command/sdist_dsc.py", line 137, in run
    build_dsc(debinfo,
  File "/home/user0/Documents/temp/pac/stdeb-release-0.10.0/stdeb/util.py", line 1569, in build_dsc
    dpkg_buildpackage(*args, cwd=fullpath_repackaged_dirname)
  File "/home/user0/Documents/temp/pac/stdeb-release-0.10.0/stdeb/util.py", line 585, in dpkg_buildpackage
    process_command(args, cwd=cwd)
  File "/home/user0/Documents/temp/pac/stdeb-release-0.10.0/stdeb/util.py", line 226, in process_command
    check_call(args, cwd=cwd)
  File "/home/user0/Documents/temp/pac/stdeb-release-0.10.0/stdeb/util.py", line 59, in check_call
    raise CalledProcessError(retcode)
stdeb.util.CalledProcessError: 2

I found similar bugreports here and here but they seem to have been fixed and my system is up to date.

Here's my /proc/version it that helps:

Linux version 5.8.0-1parrot1-amd64 ([email protected]) (gcc-10 (Debian 10.2.0-5) 10.2.0, GNU ld (GNU Binutils for Debian) 2.35) #1 SMP Debian 5.8.7-1parrot1 (2020-09-14)

Can someone tell me what the issue actually is and help me build it?

1 Answer 1

3

The error is

Cant locate Debian/Debhelper/Sequence/python3.pm in @INC

To fix this, you need to install dh-python:

sudo apt install dh-python

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.