ERROR: Can not perform a '--user' install. User site-packages are not visible in this virtualenv.

See original GitHub issue

Environment data

Version: 1.49.3 Commit: 2af051012b66169dde0c4dfae3f5ef48f787ff69 Date: 2020-10-02T17:56:11.027Z Electron: 9.2.1 Chrome: 83.0.4103.122 Node.js: 12.14.1 V8: 8.3.110.13-electron.0 OS: Linux x64 5.4.0-48-generic snap

Steps to reproduce:

python3 -m venv myenv
cd myenv
. bin/activate
code .

Then in vscode I get asked if I would like to install pylint. I click on “yes”.

The the error happens (this code was created/executed by vscode):

guettli@yoga15:~/projects/myenv$ source /home/guettli/projects/myenv/bin/activate
(myenv) guettli@yoga15:~/projects/myenv$ /home/guettli/projects/myenv/bin/python /home/guettli/.vscode/extensions/ms-python.python-2020.9.114305/pythonFiles/pyvsc-run-isolated.py pip install -U pylint --user
ERROR: Can not perform a '--user' install. User site-packages are not visible in this virtualenv.

Expected behaviour

Since the interpreter is in a virtualenv, it would make sense to avoid --user.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:19
  • Comments:18 (1 by maintainers)

github_iconTop GitHub Comments

162reactions
jwalahecommented, Jan 10, 2021

#14327 I was trying to upgrade ‘pip’ in my virtual environment. I got the same error.

One quick fix is :

  1. Go to the pyvenv.cfg file in the Virtual environment folder
  2. Set the include-system-site-packages to true and save the change
  3. Reactivate the virtual environment. This should work!
17reactions
jeffmaddockscommented, Jan 13, 2021

#14327 I was trying to upgrade ‘pip’ in my virtual environment. I got the same error.

One quick fix is :

1. Go to the `pyvenv.cfg` file in the Virtual environment folder

2. Set the `include-system-site-packages` to `true` and save the change

3. Reactivate the virtual environment.
   This should work!

worked perfectly for me, thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pip default behavior conflicts with virtualenv? - Stack Overflow
When I got to virtualenv flask command, I received this error message: Can not perform a '--user' install. User site-packages are not visible...
Read more >
Setting up virtualenv — PyCBC 2.0.6dev documentation
If this command returns Can not perform a '--user' install. User site-packages are not visible in this virtualenv. then you are already in...
Read more >
user' install. user site-packages are not visible in this virtualenv.
ERROR : Can not perform a '--user' install. User site-packages are not visible in this virtualenv. This seems fixed by removing the --user...
Read more >
Docker Airflow - ERROR: Can not perform a '--user' install ...
User site -packages are not visible in this virtualenv. GOAL. - Since 2022 Sept 19 The release of Apache Airflow 2.4.
Read more >
Python error ERROR Can not perform a --user install User site ...
... pip using the following command: python -m pip install --user --upgrade ... User site-packages are not visible in this virtualenv.
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