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

RuntimeError: Ninja is required to load C++ extensions #70

Open
pin-xue-lou opened this issue Jun 14, 2024 · 2 comments
Open

RuntimeError: Ninja is required to load C++ extensions #70

pin-xue-lou opened this issue Jun 14, 2024 · 2 comments

Comments

@pin-xue-lou
Copy link

When I use Qpytorch, it reports the following error: RuntimeError: Ninja is required to load C++ extensions. However, I have already installed Ninja, how can I solve this problem?

@aimilefth
Copy link

I have the same issue, after using pip install ninja

@aimilefth
Copy link

Using apt install ninja-build fixed the problem for me

Here is the Dockerfile, from which I can run qtorch successfully

FROM nvidia/cuda:11.4.3-base-ubuntu20.04

WORKDIR /app

RUN apt-get update && \
    apt-get install -y \
        python3-pip \
        ninja-build 
        # Ninja is QPyTorch requirement
        # libglib2.0-0

RUN pip install torch==1.13.1+cu117 -f https://download.pytorch.org/whl/torch_stable.html
RUN pip install notebook

COPY requirements.txt .
RUN pip install -r requirements.txt

The requirements.txt file is the following

imbalanced_learn==0.12.0
matplotlib==3.7.3
numpy==1.23.5
pandas==2.0.3
plotly==5.19.0
scikit_learn==1.2.2
streamlit==1.33.0
tqdm==4.66.2
torchinfo
# QPyTorch requirements
sphinx>=1.4
ipykernel
nbsphinx
qtorch

Not all packages and libraries of the Dockerfile/requirements.txt are needed to run qtorch, but this is the environment that I used.

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