-
Notifications
You must be signed in to change notification settings - Fork 1.2k
AB Experiments
The Python extension often uses A/B testing for new features. To see if you are part of an experiment, you can check the first lines in the Python extension output channel. If you wish to opt-out of A/B testing, you can open the user settings.json file (View > Command Palette… and run Preferences: Open Settings (JSON)) and set the python.experiments.enabled
setting to false
.
Hi👋 If you're one of the random people chosen in this experiment, this page is for you. We encourage you to provide feedback.
In short,
-
python.pythonPath
setting is being removed from all 3 scopes - User, workspace, workspace folder. - A new user setting
python.defaultInterpreterPath
is introduced which is meant as a replacement forpython.pythonPath
in user scope, but not in workspace scope. - A VSCode internal storage is introduced which will now store the interpreter settings in the workspace & workspace folder scope. i.e workspace settings are no longer stored in
settings.json
/.code-workspace
, but an internal storage.- You can change the value stored in workspace settings using
Python: Select Interpreter
command. - See the Python output channel to check the value of the interpreter selected.
- You can clear the value stored using
Python: Clear Workspace Interpreter Setting
command.
- You can change the value stored in workspace settings using
Note this means that you'll no longer be able to share or commit the workspace interpreter setting (formerly known as python.pythonPath
setting). Please look at the FAQ on how to opt out of this experiment if you need to.
The DeprecatePythonPath experiment changes how the Python extension stores, and users set, the path to a Python interpreter for a given Workspace. Previously, the path to the interpreter was stored in the python.pythonPath
setting, as specified in the settings.json
file. However, this storage method caused problems for users that work on teams that don’t use the same OS, or simply work with interpreters that don’t share the same path. In these situations, the setting is not valid across the team, making the process of storing a project’s settings.json
in version control difficult. There're some security concerns regarding storing workspace interpreter path in settings.json
as well. Please see
Related Issues which explains the reasoning on why we went this solution.
With the DeprecatePythonPath experiment the experience around setting and storing the interpreter path has changed in the following ways:
• The path to the workspace interpreter will now be stored in VS Code’s persistent storage instead of the settings.json
file.
• For users that want to set a default interpreter for all Workspaces, you can use the new User setting python.defaultInterpreterPath
.
• For 3rd party extensions that need access to the Python path, you can retrieve it using the extension API. Starting on the June release it will be possible to retrieve it using the command ${command:python.interpreterPath}
.
• You can change workspace-specific value using Python: Select Interpreter
command. When using the command on the Command Palette, a new option exists to specify an interpreter path.
• You can clear the value stored in workspace settings using Python: Clear Workspace Interpreter Setting
command.
• https://github.com/microsoft/vscode-python/issues/7805
• https://github.com/microsoft/vscode-python/issues/2125
Q: Can I opt out of the experiment?
A: You can opt out of any experiment by opening the user settings.json file (View > Command Palette… and run Preferences: Open Settings (JSON)) and set the “python.experiments.optOutFrom” setting to [“All”], or to specific experiments you wish to opt out from.
Q: How do I know if I’m part of the experiment?
A: To see if you are part of an experiment, you can check the first lines in the Python extension output channel.
Q: How do I add myself to the experiment?
A: You can opt in to this functionality by adding the following line to your User settings. First, run Preferences: Open Settings (JSON) and then, once you’ve added the line, reload the window by running Developer: Reload Window. "python.experiments.optInto": ["DeprecatePythonPath - experiment"]
Q: How do I report a problem I’m having with this experiment?
A: If you’re having a problem with the experiment or wish to provide feedback, please create a new issue at https://github.com/Microsoft/vscode-python/issues.