Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Build issues] cmake not found / 'ninja' has no attribute 'BIN_DIR' #110

Open
meerfrau opened this issue Nov 22, 2023 · 1 comment
Open

Comments

@meerfrau
Copy link

meerfrau commented Nov 22, 2023

I'm on Python 3.10 and cmake 3.27.8

When building with python -m build --wheel --no-isolation cmake isn't found:

ERROR Missing dependencies:
	cmake>=3.18

python-cmake-build-extension is present but seems not be needed.

When I try my old python setup.py build / python setup.py install recipe it fails:

    setup(
  File "/usr/lib/python3.10/site-packages/skbuild/setuptools_wrap.py", line 612, in setup
    cmkr = cmaker.CMaker(cmake_executable)
  File "/usr/lib/python3.10/site-packages/skbuild/cmaker.py", line 149, in __init__
    self.platform = get_platform()
  File "/usr/lib/python3.10/site-packages/skbuild/platform_specifics/platform_factory.py", line 24, in get_platform
    return linux.LinuxPlatform()
  File "/usr/lib/python3.10/site-packages/skbuild/platform_specifics/unix.py", line 18, in __init__
    ninja_executable_path = os.path.join(ninja.BIN_DIR, "ninja")
AttributeError: module 'ninja' has no attribute 'BIN_DIR'

Varying python-scikit-build from 0.15 over 0.16.3 to 0.17.6 wasn't enough. Which combination of setuptools and scikit-build works for you?

@YannickJadoul
Copy link
Owner

Hi @meerfrau. Is there a specific reason you're trying to build with --no-isolation? Normally, if you just run without, all build dependencies get installed.

The first error seems to be referring to this:

"cmake>=3.18",

In order to ensure CMake, pyproject.toml lists CMake from PyPI (https://pypi.org/project/cmake/). But since you are running with --no-isolation, those extra dependencies aren't installed.
If you really insist on using --no-isolation and on using your own CMake rather than install the one from PyPI, maybe you can remove this line from pyproject.toml, but I'm not sure.

I wouldn't directly run setup.py. I thought that's been deprecated for quite some time. When I am building wheels, I use either pip wheel (on CI) or python -m build.
On CI, just the latest versions of the packages mentioned seem to work.

Does this information help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants