-
Notifications
You must be signed in to change notification settings - Fork 345
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
uv installed on 3.9 version, but make venv on 3.7 version #2222
Labels
enhancement
New feature or request
Comments
I would recommend instead: |
Amazing, now it is working |
We could hint to UV to use the correct version as we do for virtual environments, I would expect this command to work as well. Lines 29 to 31 in 65518c9
|
Perhaps, take a look at #2058 too. |
charliermarsh
added
needs-decision
Undecided if this should be done
and removed
bug
Something isn't working
labels
Mar 8, 2024
konstin
added a commit
that referenced
this issue
Mar 10, 2024
Python tools run with `python -m <tool>` will use this `python` as their default python, including pip, virtualenv and the built-in venv. Calling Python tools this way is common, the [pip docs](https://pip.pypa.io/en/stable/user_guide/) use `python -m pip` exclusively, the built-in venv can only be called this way and certain project layouts require `python -m pytest` over `pytest`. This python interpreter takes precedence over the currently active (v)env. These tools are all written in python and read `sys.executable`. To emulate this, we're setting `UV_DEFAULT_PYTHON` in the python module-launcher shim and read it in the default python discovery, prioritizing it over the active venv. User can also set `UV_DEFAULT_PYTHON` for their own purposes. The test covers only half of the feature since we don't build the python package before running the tests. Fixes #2058 Fixes #2222
konstin
added a commit
that referenced
this issue
Mar 10, 2024
Python tools run with `python -m <tool>` will use this `python` as their default python, including pip, virtualenv and the built-in venv. Calling Python tools this way is common, the [pip docs](https://pip.pypa.io/en/stable/user_guide/) use `python -m pip` exclusively, the built-in venv can only be called this way and certain project layouts require `python -m pytest` over `pytest`. This python interpreter takes precedence over the currently active (v)env. These tools are all written in python and read `sys.executable`. To emulate this, we're setting `UV_DEFAULT_PYTHON` in the python module-launcher shim and read it in the default python discovery, prioritizing it over the active venv. User can also set `UV_DEFAULT_PYTHON` for their own purposes. The test covers only half of the feature since we don't build the python package before running the tests. Fixes #2058 Fixes #2222
konstin
added a commit
that referenced
this issue
Mar 10, 2024
Python tools run with `python -m <tool>` will use this `python` as their default python, including pip, virtualenv and the built-in venv. Calling Python tools this way is common, the [pip docs](https://pip.pypa.io/en/stable/user_guide/) use `python -m pip` exclusively, the built-in venv can only be called this way and certain project layouts require `python -m pytest` over `pytest`. This python interpreter takes precedence over the currently active (v)env. These tools are all written in python and read `sys.executable`. To emulate this, we're setting `UV_DEFAULT_PYTHON` in the python module-launcher shim and read it in the default python discovery, prioritizing it over the active venv. User can also set `UV_DEFAULT_PYTHON` for their own purposes. The test covers only half of the feature since we don't build the python package before running the tests. Fixes #2058 Fixes #2222
konstin
added a commit
that referenced
this issue
Mar 10, 2024
Python tools run with `python -m <tool>` will use this `python` as their default python, including pip, virtualenv and the built-in venv. Calling Python tools this way is common, the [pip docs](https://pip.pypa.io/en/stable/user_guide/) use `python -m pip` exclusively, the built-in venv can only be called this way and certain project layouts require `python -m pytest` over `pytest`. This python interpreter takes precedence over the currently active (v)env. These tools are all written in python and read `sys.executable`. To emulate this, we're setting `UV_DEFAULT_PYTHON` in the python module-launcher shim and read it in the default python discovery, prioritizing it over the active venv. User can also set `UV_DEFAULT_PYTHON` for their own purposes. The test covers only half of the feature since we don't build the python package before running the tests. Fixes #2058 Fixes #2222
konstin
added a commit
that referenced
this issue
Mar 13, 2024
Python tools run with `python -m <tool>` will use this `python` as their default python, including pip, virtualenv and the built-in venv. Calling Python tools this way is common, the [pip docs](https://pip.pypa.io/en/stable/user_guide/) use `python -m pip` exclusively, the built-in venv can only be called this way and certain project layouts require `python -m pytest` over `pytest`. This python interpreter takes precedence over the currently active (v)env. These tools are all written in python and read `sys.executable`. To emulate this, we're setting `UV_DEFAULT_PYTHON` in the python module-launcher shim and read it in the default python discovery, prioritizing it over the active venv. User can also set `UV_DEFAULT_PYTHON` for their own purposes. The test covers only half of the feature since we don't build the python package before running the tests. Fixes #2058 Fixes #2222
konstin
added a commit
that referenced
this issue
Mar 13, 2024
Python tools run with `python -m <tool>` will use this `python` as their default python, including pip, virtualenv and the built-in venv. Calling Python tools this way is common, the [pip docs](https://pip.pypa.io/en/stable/user_guide/) use `python -m pip` exclusively, the built-in venv can only be called this way and certain project layouts require `python -m pytest` over `pytest`. This python interpreter takes precedence over the currently active (v)env. These tools are all written in python and read `sys.executable`. To emulate this, we're setting `UV_DEFAULT_PYTHON` in the python module-launcher shim and read it in the default python discovery, prioritizing it over the active venv. User can also set `UV_DEFAULT_PYTHON` for their own purposes. The test covers only half of the feature since we don't build the python package before running the tests. Fixes #2058 Fixes #2222
zanieb
added
enhancement
New feature or request
and removed
needs-decision
Undecided if this should be done
labels
May 22, 2024
zanieb
added a commit
that referenced
this issue
May 22, 2024
…-m uv` (#3736) Closes #2222 Closes #2058 Replaces #2338 See also #2649 We use an environment variable (`UV_INTERNAL__PARENT_INTERPRETER`) to track the invoking interpreter when `python -m uv` is used. The parent interpreter is preferred over all other sources (though it will be skipped if it does not meet a `--python` request or if `--system` is used and it belongs to a virtual environment). We warn if `--system` is not provided and this interpreter would mutate system packages, but allow it.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Input:
Output:
Using Python 3.7.17 interpreter at: /usr/bin/python3 Creating virtualenv at: venv Activate with: source venv/bin/activate
The text was updated successfully, but these errors were encountered: