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

Prevent installation with pip when not in virtual environment #39

Open
ns-rse opened this issue Mar 6, 2024 · 0 comments
Open

Prevent installation with pip when not in virtual environment #39

ns-rse opened this issue Mar 6, 2024 · 0 comments

Comments

@ns-rse
Copy link
Collaborator

ns-rse commented Mar 6, 2024

Random I came across to prevent installing anything with pip outside of a virtual environment.

pip config set global.require-virtualenv True

Creates the file ~/.config/pip/pip.conf with the contents

[global]
require-virtualenv = True

And pip should then complain if you try to pip install outside of a virtualenv.

Apparently you can set the PIP_REQUIRE_VIRTUALENV=true in your .zshrc or .bashrc too.

I wonder if there is similar to prevent installation in the base conda environment. 🤔

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

No branches or pull requests

1 participant