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

fix(python): install python when pip is disabled outside virtualenv #1847

Merged
merged 1 commit into from
Mar 31, 2024

Conversation

GabDug
Copy link
Contributor

@GabDug GabDug commented Mar 30, 2024

Hey 👋

As many users, I disabled pip when outside of virtual environments, to avoid messing with my global installs, using this ~/.pip/pip.conf

[global]
require-virtualenv = true

Unfortunately, it means I must always install Python with PIP_REQUIRE_VIRTUALENV=false mise install, as pip is invoked when setting up Python with mise.

This small PR adds the environment variable in the mise command invocations.

Before

➜ mise install python@3.12.0
Downloading Python-3.12.0.tar.xz...
-> https://www.python.org/ftp/python/3.12.0/Python-3.12.0.tar.xz
Installing Python-3.12.0...
Installed Python-3.12.0 to /Users/gabdug/.local/share/mise/installs/python/3.12.0
ERROR: Could not find an activated virtualenv (required).
mise ~/.local/share/mise/installs/python/3.12.0/bin/python failed
ERROR: Could not find an activated virtualenv (required).
mise ~/.local/share/mise/installs/python/3.12.0/bin/python exited with non-zero status: exit code 3
mise Run with --verbose or MISE_VERBOSE=1 for more information

After

➜ mise install python@3.12.0
Downloading Python-3.12.0.tar.xz...
-> https://www.python.org/ftp/python/3.12.0/Python-3.12.0.tar.xz
Installing Python-3.12.0...
Installed Python-3.12.0 to /Users/gabdug/.local/share/mise/installs/python/3.12.0
[notice] A new release of pip is available: 23.2.1 -> 24.0
[notice] To update, run: /Users/gabdug/.local/share/mise/installs/python/3.12.0/bin/python -m pip install --upgrade pip
mise python@3.12.0 ✓ installed 

I can try and modify the E2E test cases if you feel this would warrant a regression check.

Thanks, and have a great day!

@jdx jdx merged commit a8ac6cd into jdx:main Mar 31, 2024
7 checks passed
@GabDug GabDug deleted the fix/python-pip-no-virtualenv branch March 31, 2024 10:28
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

Successfully merging this pull request may close these issues.

2 participants