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

use run_pip of env in executor (#2701) #2747

Closed
wants to merge 1 commit into from
Closed

use run_pip of env in executor (#2701) #2747

wants to merge 1 commit into from

Conversation

jstriebel
Copy link
Contributor

This ensures to use the correct python executable.
Using run simply uses sys.prefix with a bin suffix, which is not necessarily the currently used python executable.

E.g. when linking a specific python version to a custom directory, using sys.prefix may point to the wrong python version:

  • /usr/bin/python2.7
  • /usr/bin/python3.6
  • /usr/bin/python is a symlink to 2.7
  • /usr/bin/local/python (or any other location) is a symlink to 3.6 which shadows the former symlink
    sys.prefix is /usr in this case, which is correct, but the python executable there points to the wrong version.

run_pip in the env fixes this already by using sys.executable, see https://github.com/python-poetry/poetry/blob/develop/poetry/utils/env.py#L964
This should be used in the executor as well.


This change landed on the develop branch by mistake in #2701

This ensures to use the correct python executable.
Using `run` simply uses `sys.prefix` with a bin suffix, which is not necessarily the currently used python executable.

E.g. when linking a specific python version to a custom directory, using `sys.prefix` may point to the wrong python version:
* /usr/bin/python2.7
* /usr/bin/python3.6
* /usr/bin/python is a symlink to 2.7
* /usr/bin/local/python (or any other location) is a symlink to 3.6 which shadows the former symlink
`sys.prefix` is `/usr` in this case, which is correct, but the `python` executable there points to the wrong version.

`run_pip` in the env fixes this already by using `sys.executable`, see https://github.com/python-poetry/poetry/blob/develop/poetry/utils/env.py#L964
This should be used in the executor as well.
@jstriebel
Copy link
Contributor Author

Duplicate of #2714

@jstriebel jstriebel closed this Jul 29, 2020
@neersighted neersighted deleted the develop branch August 23, 2022 01:19
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant