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

pixi environment are recognised as "global" by pip #1226

Open
2 tasks done
abey79 opened this issue Apr 18, 2024 · 1 comment
Open
2 tasks done

pixi environment are recognised as "global" by pip #1226

abey79 opened this issue Apr 18, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@abey79
Copy link

abey79 commented Apr 18, 2024

Checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pixi, using pixi --version.

Reproducible example

$ pixi run pip --require-virtualenv freeze
ERROR: Could not find an activated virtualenv (required).

Issue description

With --require-virtualenv flag, pip refuses most operation unless a virtual environment is detected, such as to avoid installing stuff globally by mistake.

This issue happened to me because:

  • I have PIP_REQUIRE_VIRTUALENV=1 set globally.
  • maturin develop calls into pip behind the scenes

Workaround: explicitly set PIP_REQUIRE_VIRTUALENV to zero (which is easy enough for us as the maturin call is actually behind a task).

Expected behavior

Ideally, pip would think it's ok to install stuff in pixi-managed environments (though there might obviously be implications that I ignore).

@abey79 abey79 added the bug Something isn't working label Apr 18, 2024
@olivier-lacroix
Copy link
Contributor

It is an issue with any conda environment, and not only pixi ones. See for instance https://stackoverflow.com/questions/54263894/how-do-i-allow-pip-inside-anaconda3-venv-when-pip-set-to-require-virtualenv

Using tasks seems like a good way around the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants