-
Notifications
You must be signed in to change notification settings - Fork 278
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
No such file or directory: 'ninja' #642
Comments
Thanks for the bug report. At a glance, it looks like |
That's what I thought and I did try to install |
I confirm that this issue was due to ninja not available rather than pytype. |
Reopening this issue: As a matter of fact, is it possible for pytype to use Python API of ninja rather than the ninja command? In systems where users uses Python virtual environments, it can be quite tricky to get $PATH configured right especially when users work with multiple Python environments at the same time. If pytype uses the Python API of ninja, then configuring $PATH is less a problem. |
Hmm, I'm skeptical that using the Python API would fix configuration issues. If you install pytype, the ninja dependency should get installed into the same environment, so if the From a maintenance perspective: ninja isn't a Python project; it's a build system for which a third party created a pypi distribution that includes a small |
Thank you for the explanation. I will close the issue now. |
I have hit this bug too when using the path to my venv
Using venv executables without the venv active is a common-enough usecase imo, useful for getting e.g. unrelated tools to run the program. The scripts in the
However running An alternative is to execute sub-commands with the equivalent of |
I and a few other collaborators have also been hitting this in recent weeks. I believe that steps to reproduce this are as easy as temp-temp % python -m venv my_venv
temp-temp % ./my_venv/bin/pip install --upgrade pip pytype
# <stuff gets installed>
temp-temp % mkdir lol
temp-temp % cd lol
lol % touch lol.py
lol % ../my_venv/bin/pytype .
Computing dependencies
Analyzing 1 sources with 0 local dependencies
Traceback (most recent call last):
# <stack frames omitted>
FileNotFoundError: [Errno 2] No such file or directory: 'ninja': 'ninja' . Might this be reopened? If it is reopened and if @jcfr's ninja #37 is integrated into |
Weird, I'll look into this. |
Thanks for the ping and for the suggestions. As soon as I am done integrating scikit-build/ninja-python-distributions#37, I will create a new release of the wheel. I anticipate this will be completed before the end of the week. Thanks for your patience |
Summarizing the issue to the best of my understanding: pytype does not support the following common workflow: create a virtualenv, pip install X, then run X without activating the virtualenv. To fix this, pytype needs to stop doing Once scikit-build/ninja-python-distributions#37 is merged and released, 3cfc247 appears to fix the issue. Even without that change to ninja-python-distribution, I think we could fix this by looking for a @jcfr Thanks for all your work on ninja-python-distributions! One of the reasons we went with ninja for running pytype is how easy it is to install thanks to this project. |
Good summary! Yes waiting for ninja.main seems sensible |
Looks like the ninja change is merged and released! :D I'll try to close this issue out tomorrow. |
See the linked issue: this change allows pytype to be run without activating the virtualenv in which it is installed. For #642. PiperOrigin-RevId: 331883368
See the linked issue: this change allows pytype to be run without activating the virtualenv in which it is installed. For #642. PiperOrigin-RevId: 331883368
Running pytype on a Python scripts gives me the following error message.
The text was updated successfully, but these errors were encountered: