You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ERROR: Can not perform a '--user' install. User site-packages are not visible in this virtualenv. #14327
area-environmentsFeatures relating to handling interpreter environmentsbugIssue identified by VS Code Team member as probable bugverifiedVerification succeeded
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.
Reacted by @m1ru1, Darshaka Pathirana, Choyoung Im, Suraj Shrestha, Jwala Kompalli, Santos Jiménez Linares, Matti Bragge, Trish Whetzel, Yuan-Ning Chu, nikhil Prabhu and 6 more
Reacted by Isaac Fitts-Sprague, Vidhya-Vidhya and Sylvain
#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!
For me, it was the python version issue. I was using using a version not supported by Pycaret yet. I created a clean new virtual env using supported Pycaret and it worked right away
area-environmentsFeatures relating to handling interpreter environmentsbugIssue identified by VS Code Team member as probable bugverifiedVerification succeeded
Activity
karthiknadig commentedon Oct 13, 2020
I can repro this.
8 remaining items
m666m commentedon Jul 25, 2021
same problem in my vscode 1.47.3,pylance。
use “ pip install xxx ” successed。
In virtualenv, don't use "pip install xxx --user"
bitsnaps commentedon Aug 8, 2021
It didn't work for me!
I was trying to
git commit -m "..."using python v3.8.11 and cloud vscode.PrayogaBoedihartoyo commentedon Oct 31, 2021
this work for me. .
thanks
rashidmahmoodsyed commentedon Jan 2, 2022
For me, it was the python version issue. I was using using a version not supported by Pycaret yet. I created a clean new virtual env using supported Pycaret and it worked right away
besmaguesmi commentedon Jan 31, 2022
Just run cmd as administrator
ferneyvanegas commentedon Mar 1, 2022
It works perfect for me! Thanks!!
dishang-trilogy commentedon Mar 1, 2022
How do you freeze it after the install?
The freeze is not picking up the packages from requirements.txt
TahirMurtaza commentedon Jun 30, 2022
Thomas Güttler (@guettli) Using
sudobefore command fixes the issue:sudo pip install package-nameguettli commentedon Jun 30, 2022
thank you for trying to help. In this case I have a conrete goal.
At the top of this issue:
I want packages to get installed in my virtualenv, not at root-level via sudo.