question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Trouble with the packaging tutorial (Exit Speed)

See original GitHub issue

OS version

Raspbian GNU/Linux 10 (buster)

Python version

Python 3.7

Pip version

pip 21.3.1

Guide link

https://packaging.python.org/tutorials/packaging-projects

Problem description

I’m attempting to package the project I’ve been working at https://github.com/djhedges/exit_speed.

This commit shows the pyproject.toml and setup.cfg I wrote as well as the directory structure. https://github.com/djhedges/exit_speed/commit/7e0dd6f39e2ba2187c6c6aae217067b7139268d3#diff-fa602a8a75dc9dcc92261bac5f533c2a85e34fcceaff63b3a3a81d9acde2fc52

I even created a symlink to mimic the src/package layout from the documentation. I also tried setting package_dir and options.packages.find to exit_speed and . with no luck.

ls -l src/exit_speed
lrwxrwxrwx 1 pi pi 13 Jan 16 09:59 src/exit_speed -> ../exit_speed
ls -l src/exit_speed/__init__.py 
-rwxr-xr-x 1 pi pi 668 Jan 16 09:53 src/exit_speed/__init__.py

pyproject.toml

cat pyproject.toml 
[build-system]
requires = [
    "setuptools>=42",
    "wheel"
]
build-backend = "setuptools.build_meta"

setup.cfg

[metadata]
name = exit_speed
description = Race car telemetry with a Raspberry Pi
version = attr:exit_speed.__version__
author = Douglas Hedges
author_email = djhedges+exit-speed@gmail.com
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/djhedges/exit_speed
project_urls =
    Travis CL = https://app.travis-ci.com/github/djhedges/exit_speed
classifiers =
  Programming Language :: Python :: 3,
  Programming Language :: Python :: 3.7,
  License :: OSI Approved :: Apache Software License,
package_dir =
    = src
packages = find:
python_requires = >=3.7

[options.packages.find]
where = src

I’m sure I’m overlooking something silly but any help would be appreciated.

Error message

pi@exitspeed:~/git/exit_speed $ python3 -m build
* Creating virtualenv isolated environment...
* Installing packages in isolated environment... (setuptools>=42, wheel)
* Getting dependencies for sdist...
running egg_info
writing manifest file 'exit_speed.egg-info/SOURCES.txt'
* Building sdist...
running sdist
running egg_info
writing manifest file 'exit_speed.egg-info/SOURCES.txt'
running check
creating exit_speed-2022.1.16
creating exit_speed-2022.1.16/exit_speed.egg-info
copying LICENSE -> exit_speed-2022.1.16
copying README.md -> exit_speed-2022.1.16
copying pyproject.toml -> exit_speed-2022.1.16
copying setup.cfg -> exit_speed-2022.1.16
copying exit_speed.egg-info/PKG-INFO -> exit_speed-2022.1.16/exit_speed.egg-info
copying exit_speed.egg-info/SOURCES.txt -> exit_speed-2022.1.16/exit_speed.egg-info
copying exit_speed.egg-info/dependency_links.txt -> exit_speed-2022.1.16/exit_speed.egg-info
copying exit_speed.egg-info/top_level.txt -> exit_speed-2022.1.16/exit_speed.egg-info
Creating tar archive
removing 'exit_speed-2022.1.16' (and everything under it)
* Building wheel from sdist
* Creating virtualenv isolated environment...
* Installing packages in isolated environment... (setuptools>=42, wheel)
* Getting dependencies for wheel...
Traceback (most recent call last):
  File "/tmp/build-env-trakv3e2/lib/python3.7/site-packages/setuptools/config.py", line 419, in _parse_attr
    return getattr(StaticModule(module_name), attr_name)
  File "/tmp/build-env-trakv3e2/lib/python3.7/site-packages/setuptools/config.py", line 27, in __init__
    with open(spec.origin) as strm:
AttributeError: 'NoneType' object has no attribute 'origin'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pi/.local/lib/python3.7/site-packages/pep517/in_process/_in_process.py", line 363, in <module>
    main()
  File "/home/pi/.local/lib/python3.7/site-packages/pep517/in_process/_in_process.py", line 345, in main
    json_out['return_val'] = hook(**hook_input['kwargs'])
  File "/home/pi/.local/lib/python3.7/site-packages/pep517/in_process/_in_process.py", line 130, in get_requires_for_build_wheel
    return hook(config_settings)
  File "/tmp/build-env-trakv3e2/lib/python3.7/site-packages/setuptools/build_meta.py", line 163, in get_requires_for_build_wheel
    config_settings, requirements=['wheel'])
  File "/tmp/build-env-trakv3e2/lib/python3.7/site-packages/setuptools/build_meta.py", line 143, in _get_build_requires
    self.run_setup()
  File "/tmp/build-env-trakv3e2/lib/python3.7/site-packages/setuptools/build_meta.py", line 158, in run_setup
    exec(compile(code, __file__, 'exec'), locals())
  File "setup.py", line 1, in <module>
  File "/tmp/build-env-trakv3e2/lib/python3.7/site-packages/setuptools/__init__.py", line 155, in setup
    return distutils.core.setup(**attrs)
  File "/tmp/build-env-trakv3e2/lib/python3.7/site-packages/setuptools/_distutils/core.py", line 122, in setup
    dist.parse_config_files()
  File "/tmp/build-env-trakv3e2/lib/python3.7/site-packages/_virtualenv.py", line 21, in parse_config_files
    result = old_parse_config_files(self, *args, **kwargs)
  File "/tmp/build-env-trakv3e2/lib/python3.7/site-packages/setuptools/dist.py", line 805, in parse_config_files
    self, self.command_options, ignore_option_errors=ignore_option_errors
  File "/tmp/build-env-trakv3e2/lib/python3.7/site-packages/setuptools/config.py", line 158, in parse_configuration
    meta.parse()
  File "/tmp/build-env-trakv3e2/lib/python3.7/site-packages/setuptools/config.py", line 498, in parse
    section_parser_method(section_options)
  File "/tmp/build-env-trakv3e2/lib/python3.7/site-packages/setuptools/config.py", line 469, in parse_section
    self[name] = value
  File "/tmp/build-env-trakv3e2/lib/python3.7/site-packages/setuptools/config.py", line 222, in __setitem__
    value = parser(value)
  File "/tmp/build-env-trakv3e2/lib/python3.7/site-packages/setuptools/config.py", line 599, in _parse_version
    version = self._parse_attr(value, self.package_dir)
  File "/tmp/build-env-trakv3e2/lib/python3.7/site-packages/setuptools/config.py", line 422, in _parse_attr
    module = importlib.import_module(module_name)
  File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'exit_speed'

ERROR Backend subproccess exited when trying to invoke get_requires_for_build_wheel

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:17 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
djhedgescommented, Jan 17, 2022

Haha, I had a feeling I was doing something silly. Thanks for your help! That indeed was the needed fix.

0reactions
abravalhericommented, Jan 17, 2022

I found the problem 😄 … It is very difficult to spot but there is a problem in the configuration:

  License :: OSI Approved :: Apache Software License
- packages = find:
  python_requires = >=3.7

+ [options]
+ packages = find:

The packages configuration needs to be included inside the [options] section. That was the thing causing trouble. Please note that this is covered by the Packaging tutorial example.

@djhedges could you please confirm if that works for you? With this change the MANIFEST.in hack should not be necessary.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Application Packaging Process - The End-to-End Tutorial
The End-to-End application packaging process is presented in our complete tutorial. Check out the industry's best practices and insights.
Read more >
Step-by-Step Package Dieline Tutorial [with videos and ...
I think, as you read through this guide, you'll understand why you need to think of the end result for your package. Smaller...
Read more >
Package Creation Tutorial — Spack Tutorial documentation
Exit your editor to return to the command line and use the spack checksum ... the package manually to see if we can...
Read more >
RPM Packaging Guide
Feel free to file an issue ticket with feedback, submit a pull request on GitHub, or both! Prerequisites. To follow this tutorial, you...
Read more >
Use the neonUtilities Package to Access NEON Data
This tutorial goes over how to use the neonUtilities R package (formerly ... To report bugs or request new features, post an issue...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found