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

No such file or directory: '/usr/bin/pip' in projectenv.py #14

Open
StephanKuempel opened this issue Apr 5, 2022 · 4 comments
Open

Comments

@StephanKuempel
Copy link
Contributor

StephanKuempel commented Apr 5, 2022

When installed using pip install sphinx-performance, i get the follownig error on calling sphinx-performance on my build machine:

File "/home/docs-as-code-user/.local/lib/python3.8/site-packages/sphinx_performance/projectenv.py", line 250, in install_dependencies
    subprocess.call(dep_command, stdout=subprocess.DEVNULL)
  File "/usr/lib/python3.8/subprocess.py", line 3[40](https://github.boschdevcloud.com/docs-as-code/sphinx-performance-tests/runs/974184?check_suite_focus=true#step:6:40), in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib/python3.8/subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.8/subprocess.py", line 1704, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/bin/pip'

If i check for python and pip installation paths on my (provided) build machine i get:

which python -> /usr/bin/python
which pip       -> /usr/local/bin/pip
@danwos
Copy link
Member

danwos commented Apr 6, 2022

Ohh Windows, my old nemesis :)
I was not thinking about Windows, when I did the implementation.
So some path calculations may not work.
Have to check, but should not be so hard to fix.

@StephanKuempel
Copy link
Contributor Author

Ah, sorry, forgot to mention, that this is actually a unix build maching (hence /usr/bin/python and /usr/local/bin/pip).
It actually happens also for sphinx-build, which in this case is also in /usr/local/bin.

@danwos
Copy link
Member

danwos commented Apr 6, 2022

Argh sorry, and I mixed this issue with another one, where "pip.exe" was mentioned.

Understood the problem now: The executables of "python" and "pip" are in different folders, which is normally not the case, if a virtual environment is used.

So we can't use the python-path to calculate the pip-path in a save way.
Maybe which an be used (at least for linux / osx). Have to check....

@StephanKuempel
Copy link
Contributor Author

StephanKuempel commented Apr 6, 2022

I also don't know how this happened to be this way on this machine.
But as it is preinstalled already and already in the $PATH (also with venv ?) we can simply start the pyhon subprocess cmd with "pip" or "sphinx-build" even without the full path ?

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