question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

change --user behaviour in a virtualenv

See original GitHub issue

What’s the problem this feature will solve? subprocess call to pip with with --user in virtualenv currently throw an error

Describe the solution you’d like Replace the InstallationError triggered by virtualenv_no_global() with a debug message like in other cases

Alternative Solutions workaround is by construct pip3 install call dynamically

from pip._internal.utils.virtualenv import virtualenv_no_global
arg = '' if virtualenv_no_global() else '--user'

Additional context https://github.com/pypa/pip/blob/520e76ddb950e05c1b6e50b1108196c79c5e856f/src/pip/_internal/commands/install.py#L577

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
RonnyPfannschmidtcommented, Mar 11, 2020

doing that would create a situation where a script error would silently install packages in a virtualenv instead of a user-site, as far as i can tell that would be absolutely unacceptable

0reactions
pradyunsgcommented, Sep 4, 2021

I’m gonna go ahead and close this out – this error is intentional, explicitly mentioned in the PEP/by the PEP author and designed to avoid modifying the global/user environment when running within a virtual environment.

Any discussion about changes to how the user site-packages are handled should take place on python-dev or discuss.python.org, not this issue tracker.

Any configuration handling related changes can use #7902 for discussion.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Altering User Movement Behaviour in Virtual Environments
In this work, we investigated how user behaviour is affected when the Virtual Environment differs from the physical space. We created two sets...
Read more >
Pip default behavior conflicts with virtualenv? - Stack Overflow
It seems like pip defaults to --user installations though, can I change this default behavior?
Read more >
User Guide — virtualenv 20.17.2.dev2+g6845f6f documentation
The command line tool has quite a few of flags that modify the tool's behaviour, for a full list make sure to check...
Read more >
The Heat is On: Exploring User Behaviour in a Multisensory ...
The Heat is On: Exploring User Behaviour in a Multisensory Virtual Environment for Fire Evacuation. Authors:Emily Shaw, Tessa Roper, Tommy ...
Read more >
Installing packages using pip and virtual environments
When you switch projects, you can simply create a new virtual environment and not have to worry about breaking the packages installed in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found