[Internal] Use sys.executable to make sure dev setup use current env. #2998
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Currently there are some corner case scenarios that
pip
is not in the subprocess environment. To avoid this issue, we directly use sys.executable to make sure we can use correct pip in the subprocess.This pull request includes changes to the
scripts/dev-setup/main.py
file to improve the package installation process. The changes involve importing thesys
module and modifying theinstall_pkg_editable
function.Key changes include:
scripts/dev-setup/main.py
: Imported thesys
module to use the Python interpreter's executable for package installation.def install_pkg_editable(pkg: str, verbose: bool, is_vscode: bool = False) -> No
inscripts/dev-setup/main.py
: Modified the command used for package installation to usesys.executable
instead of directly callingpip
. This ensures that the correct Python interpreter is used for the installation process.All Promptflow Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines