About
Python is a programming language that lets you work more quickly and integrate your systems more effectively.
Python2 is deprecated since December 31, 2019.
Installation
Change enable
from False
to True
in the python2
section (cf module installation ).
Copy vscode-anywhere :
python2 :
enabled : True
For more details read the official documentation .
Requirements
No requirements.
VSCode
Additionnal informations
Please read the environment documentation .
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:
Copy 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:
Copy > 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:
Copy 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:
Copy > 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:
Copy 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:
Copy > 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
This extension provides a rich support for the Python language (for all actively supported versions 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!
VisualStudioExptTeam.vscodeintellicode
This extension provides AI-assisted development features for Python.
With the windows_portable
profile this extension will not be installed.
ms-python.vscode-pylance
Pylance is an extension that works alongside Python in Visual Studio Code to provide performant language support. Under the hood, Pylance is powered by Pyright , 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.
kevinrose.vsc-python-indent
This extension corrects Python indentation in Visual Studio Code.
littlefoxteam.vscode-python-test-adapter
This extension allows you to run your Python Unittest or Pytest .
VSCode-Anywhere installs python modules nose
, pytest
and configurepytest
to the default test adapter. unittest
is a builtin python module.
VSCode settings
Global settings
Copy {
"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
Copy {
"python.workspaceSymbols.ctagsPath" : "C:\\VSCode-Anywhere\\apps\\scoop\\apps\\scoop\\apps\\ctags\\current\\ctags.exe"
}
If anaconda
is set to True
:
Copy {
"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
:
Copy {
"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
.
If profile is set to windows_portable
:
Copy {
"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
Copy {
"python.workspaceSymbols.ctagsPath" : "/home/linuxbrew/.linuxbrew/bin/ctags"
}
If anaconda
is set to True
:
Copy {
'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
:
Copy {
'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
No keybindings .
Software
Windows software
scoop
anaconda2 (will be installed if anaconda
is set to true
)
msys2
The following packages will be installed only if the profile is set to windows_portable
profile :
Linux software
brew
anaconda2 (custom brew formulae only if anaconda
is set to True
)
nix
Documentation
VSCode-Anywhere
Environment
Windows environment
Copy 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
:
Copy 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
Copy 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
:
Copy 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
Allow to install anaconda :
Copy vscode-anywhere :
python2 :
enabled : True
enaconda : True
Please read:
This is a recommended method for the data sciences and with the use of Jupyter .
anaconda_update
Update all anaconda modules:
Copy vscode-anywhere :
python2 :
enabled : True
enaconda : True
enaconda_update : True
Requires that anaconda
be set to True
.
pip
Allow installing packages with 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
is not mandatory but allows to pass additional arguments.
Extra args can be arguments described in the Saltstack pip states or can be global Saltstack arguments .
Global opts
packages settings:
pip:pkgs:opts:global
: allow passing arguments to all pip packages when installing , updating , or uninstalling a package
pm:pkgs:opts:install
: allow passing arguments to all pip packages when installing a package (cf states.pip.installed )
pip:pkgs:opts:update
: allow passing arguments to all pip packages when updating a package (cf states.pip.installed )
pip:pkgs:opts:uninstall
: allow passing arguments to all pip packages when uninstalling a package (cf states.pip.removed )
Specific opts
packages settings:
pip:<mypkg>:opts:global
: allow passing arguments to <mypkg>
pip package when installing , updating , or uninstalling the package
pip:pkgs:<mypkg>:opts:install
: allow passing arguments to <mypkg>
pip packages when installing the package (cf states.pip.installed )
pip:pkgs:<mypkg>:opts:update
: allow passing arguments to <mypkg>
pip packages when updating the package (cf states.pip.installed )
pip:pkgs:<mypkg>:opts:uninstall
: allow passing arguments to all pip packages when uninstalling a package (cf states.pip.removed )
Replace <mypkg>
by the name of the package to install.
Copy 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 : {}
If anaconda
is set to True
:
Copy 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
:
Copy 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
.
If the profile is set to windows_portable
:
Copy 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
.
Copy 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
:
Copy 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
:
Copy vscode-anywhere :
python2 :
enabled : True
pip :
opts :
global :
bin_env : /home/linuxbrew/.linuxbrew/opt/anaconda2/bin/pip