VSCode-Anywhere
  • Introduction
  • Installation
    • Requirements
      • Windows requirements
      • Linux requirements
      • MacOS requirements
    • Quickstart
    • Advanced
      • Windows installation
      • Linux installation
      • MacOS installation
  • Modules
    • Module installation
    • Module update
    • Module settings
      • Global settings
        • brew settings
        • chocolatey settings
        • env settings
        • msys2 settings
        • nix settings
        • scoop settings
        • vscode settings
        • zeal settings
    • Modules list
      • Ansible
      • Bash
      • C / C++
      • C#
      • Custom
      • Deepcode
      • Docker
      • Fonts
      • Git
      • Go
      • HTML
      • Java
      • JavaScript / TypeScript
      • Markdown
      • Perl
      • PHP
      • Platformio
      • PowerShell
      • Puppet
      • Python2
      • Python3
      • Remote
      • Rest
      • ReStructuredText
      • Ruby
      • Saltstack
      • VSCode
    • Custom modules
  • Structure
    • apps
    • conf
      • saltstack
        • conf-offline
        • conf
        • pillar
        • states
    • tools
      • env
      • install
      • link
      • update
      • vscode
      • vscode-anywhere
  • Tutorials
    • Youtube tutorials
  • Release notes
    • V2
      • V2.0.0
    • V1
  • FAQ
Powered by GitBook
On this page
  • About
  • Installation
  • Requirements
  • VSCode
  • Additionnal informations
  • VSCode extensions
  • VSCode settings
  • Linux Settings
  • VSCode keybindings
  • Software
  • Windows software
  • Linux software
  • Documentation
  • VSCode-Anywhere
  • Environment
  • Specific settings

Was this helpful?

  1. Modules
  2. Modules list

Python2

PreviousPuppetNextPython3

Last updated 4 years ago

Was this helpful?

About

is a programming language that lets you work more quickly and integrate your systems more effectively.

Python2 is deprecated since December 31, 2019.

Installation

vscode-anywhere:
    python2:
        enabled: True

Requirements

No requirements.

VSCode

Additionnal informations

By default, the Python extension looks for and loads a file named .env in the current workspace folder, then applies those definitions. The file is identified by the default entry "python.envFile": "${workspaceFolder}/.env.

And you can also interact with your environment with the VSCode settings .vscode/settings.json:

  • python.envFile: Absolute path to a file containing environment variable definitions

  • python.venvPath: Path to the folder with a list of Virtual Environments

  • python.venvFolders: Folders in your home directory to look into for virtual environments (supports pyenv, direnv and virtualenvwrapper by default)

And also use environment variable (you can set these variables directly in your python.envFile:

  • WORKON_HOME: used by virtualenvwrapper and pipenv

  • PYTHONPATH: specifies additional locations where the Python interpreter should look for modules

virtualenv

If you want to test directly your virtualenv without configuring your settings:

cd <path_to_your_project>
. <installation_directory>\tools\env.ps1
.\<env>\bin\activate
VSCode-Anywhere .

After that, you must select a Python interpreter. Press F1 and type:

> Python Select Interpreter

And select the right interpreter (virtualenv) from the list provided.

pipenv

If you want to test directly your pipenv without configuring your settings:

cd <path_to_your_project>
. C:\VSCode-Anywhere\tools\env.ps1
pipenv shell
VSCode-Anywhere .

After that, you must select a Python interpreter. Press F1 and type:

> Python Select Interpreter

And select the right interpreter from the list provided.

poetry

If you want to test directly your poetry without configuring your settings:

cd <path_to_your_project>
. C:\VSCode-Anywhere\tools\env.ps1
poetry shell
VSCode-Anywhere .

After that, you must select a Python interpreter. Press F1 and type:

> Python Select Interpreter

And select the right interpreter from the list provided.

anaconda

Please read the specific settings at the bottom of the page.

VSCode extensions

ms-python.python

VisualStudioExptTeam.vscodeintellicode

ms-python.vscode-pylance

kevinrose.vsc-python-indent

littlefoxteam.vscode-python-test-adapter

VSCode-Anywhere installs python modules nose, pytest and configurepytestto the default test adapter. unittest is a builtin python module.

VSCode settings

Global settings

{
  "python.analysis.typeCheckingMode": "basic",
  "python.languageServer": "Pylance",
  "python.testing.pytestEnabled": True,
  "code-runner.executorMap.python": "$pythonPath -u $fullFileName",
  "python.linting.pylintEnabled": False,
  "python.linting.flake8Enabled": True,
  "python.linting.enabled": True,
  "python.autoComplete.addBrackets": True,
  "python.formatting.provider": "autopep8",
  "dash.languageIdToDocsetMap.python": [
    "django",
    "twisted",
    "sphinx",
    "flask",
    "tornado",
    "sqlalchemy",
    "numpy",
    "scipy",
    "salt",
    "pandas",
    "matplotlib",
    "cvp"
  ]
}

Windows settings

{
    "python.workspaceSymbols.ctagsPath": "C:\\VSCode-Anywhere\\apps\\scoop\\apps\\scoop\\apps\\ctags\\current\\ctags.exe"
}

If anaconda is set to True:

{
    "python.condaPath": "C:\\VSCode-Anywhere\\apps\\scoop\\apps\\anaconda2\\current\\Scripts\\conda.exe",
    "python.pythonPath": "C:\\VSCode-Anywhere\\apps\\scoop\\apps\\anaconda2\\current\\python.exe",
    "python.formatting.autopep8Path": "C:\\VSCode-Anywhere\\apps\\scoop\\apps\\anaconda2\\current\\Scripts\\autopep8.exe",
    "python.poetryPath": "C:\\VSCode-Anywhere\\apps\\scoop\\apps\\anaconda2\\current\\Scripts\\poetry.exe",
    "python.linting.flake8Path": "C:\\VSCode-Anywhere\\apps\\scoop\\apps\\anaconda2\\current\\Scripts\\flake8.exe",
    "python.testing.nosetestPath": "C:\\VSCode-Anywhere\\apps\\scoop\\apps\\anaconda2\\current\\Scripts\\nosetests.exe",
    "python.testing.pytestPath": "C:\\VSCode-Anywhere\\apps\\scoop\\apps\\anaconda2\\current\\Scripts\\pytest.exe",
    "python.pipenvPath": "C:\\VSCode-Anywhere\\apps\\scoop\\apps\\anaconda2\\current\\Scripts\\pipenv.exe"
}

Assuming you have installed in the default directory C:\VSCode-Anywhere.

If anaconda is set to False:

{
    "python.pythonPath": "C:\\VSCode-Anywhere\\apps\\scoop\\apps\\python27\\current\\python.exe",,
    "python.formatting.autopep8Path": "C:\\VSCode-Anywhere\\apps\\scoop\\apps\\python27\\current\\Scripts\\autopep8.exe",
    "python.poetryPath": "C:\\VSCode-Anywhere\\apps\\scoop\\apps\\python27\\current\\Scripts\\poetry.exe",
    "python.linting.flake8Path": "C:\\VSCode-Anywhere\\apps\\scoop\\apps\\python27\\current\\Scripts\\flake8.exe",
    "python.testing.nosetestPath": "C:\\VSCode-Anywhere\\apps\\scoop\\apps\\python27\\current\\Scripts\\nosetests.exe",
    "python.testing.pytestPath": "C:\\VSCode-Anywhere\\apps\\scoop\\apps\\python27\\current\\Scripts\\pytest.exe",
    "python.pipenvPath": "C:\\VSCode-Anywhere\\apps\\scoop\\apps\\python27\\current\\Scripts\\pipenv.exe"
}

Assuming you have installed in the default directory C:\VSCode-Anywhere.

{
      "python.languageServer": "Jedi",
      "python.pythonPath": "C:\\VSCode-Anywhere\\apps\\scoop\\apps\\msys2\\current\\usr\\bin\\python2",
      "python.formatting.autopep8Path": "C:\\VSCode-Anywhere\\apps\\scoop\\apps\\msys2\\current\\usr\\bin\\autopep8",
      "python.poetryPath": "C:\\VSCode-Anywhere\\apps\\scoop\\apps\\msys2\\current\\usr\\bin\\poetry",
      "python.pipenvPath": "C:\\VSCode-Anywhere\\apps\\scoop\\apps\\msys2\\current\\usr\\bin\\pipenv",
      "python.linting.flake8Path": "C:\\VSCode-Anywhere\\apps\\scoop\\apps\\msys2\\current\\usr\\bin\\flake8",
      "python.testing.nosetestPath": "C:\\VSCode-Anywhere\\apps\\scoop\\apps\\msys2\\current\\usr\\bin\\nose",
      "python.testing.pytestPath": "C:\\VSCode-Anywhere\\apps\\scoop\\apps\\msys2\\current\\usr\\bin\\pytest"
}

Assuming you have installed in the default directory C:\VSCode-Anywhere.

Linux Settings

{
    "python.workspaceSymbols.ctagsPath": "/home/linuxbrew/.linuxbrew/bin/ctags"
}

If anaconda is set to True:

{
    'pythonPath': '/home/linuxbrew/.linuxbrew/opt/anaconda2/bin/python2',
    'autopep8Path': '/home/linuxbrew/.linuxbrew/opt/anaconda2/bin/autopep8',
    'poetryPath': '/home/linuxbrew/.linuxbrew/opt/anaconda2/bin/poetry',
    'flake8Path': '/home/linuxbrew/.linuxbrew/opt/anaconda2/bin/flake8',
    'nosetestPath': '/home/linuxbrew/.linuxbrew/opt/anaconda2/bin/nosetests',
    'pytestPath': '/home/linuxbrew/.linuxbrew/opt/anaconda2/bin/pytest',
    'pipenvPath': '/home/linuxbrew/.linuxbrew/opt/anaconda2/bin/pipenv',
    'python.condaPath': '/home/linuxbrew/.linuxbrew/opt/anaconda2/conda'
}

If anaconda is set to False:

{
    'pythonPath': '/home/myuser/VSCode-Anywhere/apps/vscode-anywhere/home/.nix-profile/bin/python2',
    'autopep8Path': '/home/myuser/VSCode-Anywhere/apps/vscode-anywhere/home/.nix-profile/bin/autopep8',
    'poetryPath': '/home/myuser/VSCode-Anywhere/apps/vscode-anywhere/home/.nix-profile/bin/poetry',
    'flake8Path': '/home/myuser/VSCode-Anywhere/apps/vscode-anywhere/home/.nix-profile/bin/flake8',
    'nosetestPath': '/home/myuser/VSCode-Anywhere/apps/vscode-anywhere/home/.nix-profile/bin/nosetests',
    'pytestPath': '/home/myuser/VSCode-Anywhere/apps/vscode-anywhere/home/.local/bin/pytest',
    'pipenvPath': '/home/myuser/VSCode-Anywhere/apps/vscode-anywhere/home/.local/bin/pipenv'
}

Assuming you have installed in the directory /home/myuser/VSCode-Anywhere.

VSCode keybindings

Software

Windows software

scoop

msys2

Linux software

brew

  • anaconda2 (custom brew formulae only if anaconda is set to True)

nix

Documentation

VSCode-Anywhere

Environment

Windows environment

PATH: C:\VSCode-Anywhere\apps\scoop\apps\python27\current\Scripts

Assuming you have installed in the default directory C:\VSCode-Anywhere.

If anaconda is set to True:

PATH: C:\VSCode-Anywhere\apps\scoop\apps\python27\current\Scripts;C:\VSCode-Anywhere\apps\anaconda2\current:C:\VSCode-Anywhere\apps\anaconda2\current\Library\mingw-64\bin:C:\VSCode-Anywhere\apps\anaconda2\current\Library\usr\bin::C:\VSCode-Anywhere\apps\anaconda2\current\Library\bin::C:\VSCode-Anywhere\apps\anaconda2\current\Library\Scripts

Assuming you have installed in the default directory C:\VSCode-Anywhere.

Linux environment

PATH: /home/myuser/VSCode-Anywhere/apps/vscode-anywhere/home/.local/bin

Assuming you have installed in the directory /home/myuser/VSCode-Anywhere.

If anaconda is set to True:

PATH: /home/myuser/VSCode-Anywhere/apps/vscode-anywhere/home/.local/bin:/home/linuxbrew/.linuxbrew/opt/anaconda2/bin

Assuming you have installed in the directory /home/myuser/VSCode-Anywhere.

Specific settings

anaconda

vscode-anywhere:
  python2:
    enabled: True
    enaconda: True

Please read:

anaconda_update

vscode-anywhere:
  python2:
    enabled: True
    enaconda: True
    enaconda_update: True

Requires that anaconda be set to True.

pip

  • pkgs: name of the packages to install

    • enabled: True to enable, False to skip (default to False)

    • version: the version of the pip package

  • opts

opts is not mandatory but allows to pass additional arguments.

Global opts packages settings:

  • pip:pkgs:opts:global: allow passing arguments to all pip packages when installing, updating, or uninstalling a package

Specific opts packages settings:

  • pip:<mypkg>:opts:global: allow passing arguments to <mypkg> pip package when installing, updating, or uninstalling the package

Replace <mypkg> by the name of the package to install.

  • global:

vscode-anywhere:
  python2:
    enabled: True
      pip:
        opts:
          install:
            upgrade: False
          update:
            upgrade: True
          uninstall: {}
        pkgs:
          rope:
            enabled: True
            version: null
            opts:
              install: {}
              update: {}
              uninstall: {}
          flake8:
            enabled: True
            version: null
            opts:
              install: {}
              update: {}
              uninstall: {}
          autopep8:
            enabled: True
            version: null
            opts:
              install: {}
              update: {}
              uninstall: {}
          ptvsd:
            enabled: True
            version: null
            opts:
              install: {}
              update: {}
              uninstall: {}
          nose:
            enabled: True
            version: null
            opts:
              install: {}
              update: {}
              uninstall: {}
          pytest:
            enabled: True
            version: null
            opts:
              install: {}
              update: {}
              uninstall: {}
          pytest-xdist:
            enabled: True
            version: null
            opts:
              install: {}
              update: {}
              uninstall: {}
          poetry:
            enabled: True
            version: null
            opts:
              install: {}
              update: {}
              uninstall: {}
          pipenv:
            enabled: True
            version: null
            opts:
              install: {}
              update: {}
              uninstall: {}
    
  • Windows:

If anaconda is set to True:

vscode-anywhere:
  python2:
    enabled: True
    pip:
      opts:
        global:
          bin_env: C:\VSCode-Anywhere\apps\scoop\apps\python27\current\Scripts\pip.exe

Assuming you have installed in the default directory C:\VSCode-Anywhere.

If anaconda is set to False:

vscode-anywhere:
  python2:
    enabled: True
    pip:
      opts:
        global:
          bin_env: C:\VSCode-Anywhere\apps\scoop\apps\anaconda2\current\Scripts\pip.exe

Assuming you have installed in the default directory C:\VSCode-Anywhere.

vscode-anywhere:
  python2:
    enabled: True
    pip:
      opts:
        global:
          bin_env: C:\VSCode-Anywhere\apps\msys2\current\usr\bin\pip2

Assuming you have installed in the default directory C:\VSCode-Anywhere.

  • Linux:

vscode-anywhere:
  python2:
    enabled: True
    pip:
      pkgs:
        setuptools:
          enabled: True
          version: null
          opts:
            install: {}
            update: {}
            uninstall: {}
        rope:
          enabled: False
        flake8:
          enabled: False
        autopep8:
          enabled: False
        nose:
          enabled: False
        peotry:
          enabled: False

If anaconda is set to True:

vscode-anywhere:
  python2:
    enabled: True
    pip:
      opts:
        global:
          bin_env: /home/myuser/VSCode-Anywhere/apps/vscode-anywhere/home/.nix-profile/bin/pip2
          env_vars:
            PYTHONPATH: ''

Assuming you have installed in the directory /home/myuser/VSCode-Anywhere.

If anaconda is set to False:

vscode-anywhere:
  python2:
    enabled: True
    pip:
      opts:
        global:
          bin_env: /home/linuxbrew/.linuxbrew/opt/anaconda2/bin/pip

Change enable from False to True in the python2 section (cf ).

You can also take a look at the .

For more details read the .

Please read the .

This provides a rich support for the (for all of the language: 2.7, >=3.5), including features such as IntelliSense, linting, debugging, code navigation, code formatting, Jupyter notebook support, refactoring, variable explorer, test explorer, snippets, and more!

This provides AI-assisted development features for Python.

With the windows_portable this extension will not be installed.

that works alongside Python in Visual Studio Code to provide performant language support. Under the hood, Pylance is powered by , Microsoft's static type checking tool. Using Pyright, Pylance has the ability to supercharge your Python IntelliSense experience with rich type information, helping you write better code faster.

This corrects Python indentation in Visual Studio Code.

This allows you to run your Python or .

If is set to windows_portable:

No .

(will not be installed with the windows_portable )

(will be installed if anaconda is set to true)

The following packages will be installed only if the profile is set to windows_portable :

Allow to install :

the

the

the

This is a recommended method for the data sciences and with the use of .

Update all modules:

Allow installing packages with .

Extra args can be arguments described in the or can be .

pm:pkgs:opts:install: allow passing arguments to all pip packages when installing a package (cf )

pip:pkgs:opts:update: allow passing arguments to all pip packages when updating a package (cf )

pip:pkgs:opts:uninstall: allow passing arguments to all pip packages when uninstalling a package (cf )

pip:pkgs:<mypkg>:opts:install: allow passing arguments to <mypkg> pip packages when installing the package (cf )

pip:pkgs:<mypkg>:opts:update: allow passing arguments to <mypkg> pip packages when updating the package (cf )

pip:pkgs:<mypkg>:opts:uninstall: allow passing arguments to all pip packages when uninstalling a package (cf )

If the is set to windows_portable:

module installation
VSCode-Anywhere python2 module configuration
official documentation
environment documentation
extension
Python language
actively supported versions
extension
Pylance is an extension
Pyright
extension
extension
Unittest
Pytest
keybindings
ctags
anaconda2
python2
python2-pip
gcc
libcrypt-devel
ctags
nixpkgs.python27Full
nixpkgs.python27Packages.pip
nixpkgs.python27Packages.rope
nixpkgs.python27Packages.flake8
nixpkgs.python27Packages.autopep8
nixpkgs.python27Packages.nose
nixpkgs.python27Packages.poetry
Python_2
PEPs
anaconda
VSCode documentation for anaconda
VSCode documentation for Jupyter Notebook
VSCode documentation for Interactive Python (IPython)
Jupyter
anaconda
pip
Saltstack pip states
global Saltstack arguments
states.pip.installed
states.pip.installed
states.pip.removed
states.pip.installed
states.pip.installed
states.pip.removed
Python
python27
profile
profile
profile
profile
profile