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

Install Via pip Fails Due to Dependency scikit-build #27

Closed
AntumDeluge opened this issue Aug 6, 2019 · 8 comments
Closed

Install Via pip Fails Due to Dependency scikit-build #27

AntumDeluge opened this issue Aug 6, 2019 · 8 comments

Comments

@AntumDeluge
Copy link

Originally submitted here: ninja-build/ninja#1608

I believe that scikit-build should be added as a dependency in pip install as I get the following error if it is not installed:

$ pip install ninja
Collecting ninja
  Using cached https://files.pythonhosted.org/packages/dd/96/e2ec4acccb8dee33b4987f553d531d61e3081c8d4cfbce249655dfe23906/ninja-1.9.0.post1.tar.gz
    ERROR: Complete output from command python setup.py egg_info:
    ERROR: Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-av7tfuja/ninja/setup.py", line 7, in <module>
        from skbuild import setup
    ModuleNotFoundError: No module named 'skbuild'
    ----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-av7tfuja/ninja/

Edit: System & platform information:

OS: Microsoft Windows 10 64-bit
Python & pip info:

$ python --version
Python 3.7.4

$ python -c 'import sys; print("64-bit: {}".format(sys.maxsize > 2**32))'
64-bit: True

$ pip --version
pip 19.1 from /usr/lib/python3.7/site-packages/pip (python 3.7)

$ pip search ninja
ninja (1.9.0.post1)                               - Ninja is a small build
                                                    system with a focus on
                                                    speed
...
@grische
Copy link

grische commented Sep 18, 2019

@jcfr would it be possible to add this dependency?

@jcfr
Copy link
Contributor

jcfr commented Sep 18, 2019

since ninja binaries are expected to be available as wheel for all python distributions, it is not expected that we built it from source.

I think we should understand the root cause here.

Indeed, the wheels are expected to work with all python distributions. See https://pypi.org/project/ninja/#files

Using the python interpreter where there are issues, what is the output of the following:

from pip._internal.pep425tags import get_supported
print('\n'.join('-'.join(x) for x in get_supported()))

@grische
Copy link

grische commented Sep 18, 2019

@jcfr I built a very simple testcase for you to reproduce the issue:

  1. Create a Dockerfile with the following content
FROM alpine:3.10

# install python3 (incl. pip3)
RUN apk add --no-cache --update python3

# add example file
RUN echo -e "from pip._internal.pep425tags import get_supported\nprint('\\\n'.join('-'.join(x) for x in get_supported()))" > /jcfr_test.py
RUN python3 /jcfr_test.py

# install ninja dependency manually
#RUN pip3 install 'scikit-build==0.10.0'

RUN pip3 install ninja
  1. Run docker build --no-cache -t jcfr_test .

This results in

Step 4/5 : RUN python3 /jcfr_test.py
 ---> Running in 59175424ed96
cp37-cp37m-linux_x86_64
cp37-abi3-linux_x86_64
cp37-none-linux_x86_64
cp36-abi3-linux_x86_64
cp35-abi3-linux_x86_64
cp34-abi3-linux_x86_64
cp33-abi3-linux_x86_64
cp32-abi3-linux_x86_64
py3-none-linux_x86_64
cp37-none-any
cp3-none-any
py37-none-any
py3-none-any
py36-none-any
py35-none-any
py34-none-any
py33-none-any
py32-none-any
py31-none-any
py30-none-any
Removing intermediate container 59175424ed96
 ---> 5f0b70a8bc10
Step 5/5 : RUN pip3 install ninja
 ---> Running in 8124dbb4abb5
Collecting ninja
  Downloading https://files.pythonhosted.org/packages/dd/96/e2ec4acccb8dee33b4987f553d531d61e3081c8d4cfbce249655dfe23906/ninja-1.9.0.post1.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-c4xl435b/ninja/setup.py", line 7, in <module>
        from skbuild import setup
    ModuleNotFoundError: No module named 'skbuild'

@grische
Copy link

grische commented Oct 21, 2019

@jcfr is there any change regarding this issue?

@andreparames
Copy link

@jcfr

Indeed, the wheels are expected to work with all python distributions.

Unfortunately not: pypa/pip#3969

Unfortunately (this word does come to mind repeatedly when thinking of Python packaging), requiring a build dependency can only be done by adding another file to the source tarball. Example: https://github.com/prody/ProDy/pull/806/files

But that should solve the problem for us alpine users 🙂

@bsolomon1124
Copy link

bsolomon1124 commented Feb 7, 2020

@andreparames can you please clarify what you mean by "that should solve the problem for us alpine users"? Which step are you suggesting solves that problem?

@andreparames
Copy link

andreparames commented Feb 7, 2020

@bsolomon1124 you have to add a pyproject.toml file to the root of the project (see example linked in my previous comment), with scikit-build in the requires line. That way, it'll fetch that dependency before building ninja.

@mayeut
Copy link
Contributor

mayeut commented Jul 17, 2021

Fixed in 1.10.0.post3

@mayeut mayeut closed this as completed Jul 17, 2021
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

6 participants