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.

pip linter install fails

See original GitHub issue

Environment data

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)

none

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9

github_iconTop GitHub Comments

6reactions
farid220commented, 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": 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

5reactions
hadigcommented, Apr 18, 2018

For @farid220 solution you need to change default python to 3.x in the bottom left of vsCode

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error message "Linter pylint is not installed" - Stack Overflow
Check the path Pylint has been installed to, by typing which pylint on your terminal. You will get something like: /usr/local/bin/pylint.
Read more >
microsoft/vscode-python - Installing of linter via pip fails - GitHub
Hi y'all! I've been having this problem for a while now and it only shows up when I'm working in a virtual environment...
Read more >
Unable to Install Pylint - Python - Code with Mosh Forum
I am up to 1.6 which explains how to install the python extension and ... and VS Code is not running elevated, linter...
Read more >
Linting Python in Visual Studio Code
Open a command prompt, navigate to the location where your selecter interpreter is, and run pip install for the linter. The path to...
Read more >
restructuredtext-lint - PyPI
pip install restructuredtext-lint ... Returns 0 if all files pass linting, 1 for an internal error, and 2 if linting failed. positional arguments:...
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