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.

Warning about system python in MacOS but correctly uses virtualenv

See original GitHub issue

Environment data

VS Code version: 1.20.1 Python Extension version: 2018.1.0 Python Version: 3.5.4 and 2.7.10 OS and version: MacOS 10.13.3

Actual behavior

VSCode shows a warning: “Selected interpreter is macOS system python which is not recommended. Please select different interpreter” but the venv version (3.5.4) is correctly selected (see screenshot) and seems to be correctly used (the system version is 2.7.10). screen shot 2018-02-16 at 17 54 10

Expected behavior

The warning shouldn’t be shown

Steps to reproduce:

  • cd to the project folder
  • activate the virtualenv
  • code .

Logs

Output from Python output panel

##########Linting Output - flake8##########
Traceback (most recent call last):
  File "/usr/local/bin/flake8", line 11, in <module>
    load_entry_point('flake8==3.5.0', 'console_scripts', 'flake8')()
  File "/usr/local/Cellar/flake8/3.5.0/libexec/lib/python2.7/site-packages/flake8/main/cli.py", line 16, in main
    app.run(argv)
  File "/usr/local/Cellar/flake8/3.5.0/libexec/lib/python2.7/site-packages/flake8/main/application.py", line 396, in run
    self._run(argv)
  File "/usr/local/Cellar/flake8/3.5.0/libexec/lib/python2.7/site-packages/flake8/main/application.py", line 383, in _run
    self.initialize(argv)
  File "/usr/local/Cellar/flake8/3.5.0/libexec/lib/python2.7/site-packages/flake8/main/application.py", line 361, in initialize
    self.parse_preliminary_options_and_args(argv)
  File "/usr/local/Cellar/flake8/3.5.0/libexec/lib/python2.7/site-packages/flake8/main/application.py", line 133, in parse_preliminary_options_and_args
    opts, args = self.option_manager.parse_known_args(args)
  File "/usr/local/Cellar/flake8/3.5.0/libexec/lib/python2.7/site-packages/flake8/options/manager.py", line 307, in parse_known_args
    self.parser.largs.append(err.opt_str)
AttributeError: 'OptionValueError' object has no attribute 'opt_str'
##########Linting Output - pylint##########
No config file found, using default configuration
##########Linting Output - mypy##########

Output from Console window (Help->Developer Tools menu)

screen shot 2018-02-16 at 17 59 05

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
MikhailArkhipovcommented, Feb 17, 2018

Yes, we are working on the fix. I just meant temp workaround.

4reactions
MikhailArkhipovcommented, Feb 16, 2018

If it is annoying you, you can set disableInstallationChecks to true in settings

Read more comments on GitHub >

github_iconTop Results From Across the Web

Warning about system python in MacOS but correctly uses ...
VSCode shows a warning: "Selected interpreter is macOS system python which is not recommended. Please select different interpreter" but the venv ...
Read more >
How to install and run virtualenv on MacOS correctly
I just want to run virtualenv normally and create flask project ... PS. I can "sudo pip3 install flask" and "pip3 show flask"...
Read more >
12. Virtual Environments and Packages — Python 3.11.1 ...
The solution for this problem is to create a virtual environment, a self-contained directory tree that contains a Python installation for a particular...
Read more >
Python Virtual Environments: A Primer
In this tutorial, you'll learn how to work with Python's venv module to create and manage separate virtual environments for your Python ......
Read more >
Using Python environments in VS Code
Using Python environments in VS Code. This article discusses the helpful Python environments features available in Visual Studio Code. An "environment" 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