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
VS Code version: 1.20.1
Python Extension version: 2018.1
Python Version: 3.6.4 (Homebrew & virtualenvwrapper)
OS and version: MacOS 10.13.3
Actual behavior
Using Cmd-Shift-P, I select for example 'mypy' which is not installed in my virtual environment. When I click Install, python3 -m pip install -U mypy --user fails, with message Can not perform a '--user' install. User site-packages are not visible in this virtualenv.
Expected behavior
Expect mypy to be installed in my virtual environment's site-packages directory.
Steps to reproduce:
Set up virtual environment with virtualenvwrapper.
Open vscode from the terminal with the virtual env already activated (workon...).
Rest as described in Actual behavior.
I see that --user is hard-coded in pipInstaller.ts (which I suspect is doing the installing). Is there a way to override that setting? Or am I getting something wrong?
In the end, I was able to manually install the linter to be able to move forward, and that seems to be working correctly. Would be nice to be able to depend on the install procedure though.
Thanks.
Logs
Output from Python output panel
none
Output from Console window (Help->Developer Tools menu)
Yes. That worked. Pip successfully installed mypy to my virtual environment, as expected.
But now I'm confused about why it worked. globalModuleInstallation sounds like it should install to the main Python site-packages, not to the one in the virtual environment.
But perhaps I don't understand the logic behind it yet, so I'll just leave it at that.
Hello Friends
I had the same issue and tried all of the solutions on github but no result
such as: "code-runner.runInTerminal": true "python.pythonPath": "/usr/local/bin/python3" "globalModuleInstallation": true
and so on (granting root access for python path - and ....)
the solution was so simple and because the installer installs packages with python 3 , we should use pip3 (pip for python 3) either
just run this command and it is over
sudo apt-get install python3-pip
This is my first comment on github if I apologies previously if I have some styling and grammatical problem
Reacted by hadig, Vlad Lazar, Abdurrahman, crcomptis, Leonardo U Spairani and Ewan
Activity
MikhailArkhipov commentedon Feb 17, 2018
Try setting
globalModuleInstallationto truewlbentley commentedon Feb 17, 2018
Yes. That worked. Pip successfully installed mypy to my virtual environment, as expected.
But now I'm confused about why it worked.
globalModuleInstallationsounds like it should install to the main Python site-packages, not to the one in the virtual environment.But perhaps I don't understand the logic behind it yet, so I'll just leave it at that.
Thanks so much.
MikhailArkhipov commentedon Feb 17, 2018
It is just a workaround. Working on the actual fix for next update.
wlbentley commentedon Feb 17, 2018
Got it. I'm fine with closing this issue. Thanks again.
MikhailArkhipov commentedon Feb 20, 2018
I'll close it with the real fix :-)
MikhailArkhipov commentedon Feb 20, 2018
d44386e
farid220 commentedon Apr 14, 2018
Hello Friends
I had the same issue and tried all of the solutions on github but no result
such as:
"code-runner.runInTerminal": true"python.pythonPath": "/usr/local/bin/python3""globalModuleInstallation": trueand so on (granting root access for python path - and ....)
the solution was so simple and because the installer installs packages with python 3 , we should use pip3 (pip for python 3) either
just run this command and it is over
sudo apt-get install python3-pipThis is my first comment on github if I apologies previously if I have some styling and grammatical problem
hadig commentedon Apr 18, 2018
For farid220 solution you need to change default python to 3.x in the bottom left of vsCode
ewanlee commentedon Jul 5, 2018
farid220 This method is also valid for python2