Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Activate environment before debugging tests #4300

Closed
mbunse opened this issue Feb 6, 2019 · 55 comments
Closed

Activate environment before debugging tests #4300

mbunse opened this issue Feb 6, 2019 · 55 comments
Assignees
Labels
area-debugging area-environments Features relating to handling interpreter environments area-testing bug Issue identified by VS Code Team member as probable bug verified Verification succeeded

Comments

@mbunse
Copy link

mbunse commented Feb 6, 2019

  • VS Code version: 1.30.2
  • Extension version (available under the Extensions sidebar): 2019.1.0
  • OS and version: Windows 7
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.7.1, anaconda
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
  • Relevant/affected Python packages and their versions: numpy

Expected behaviour

Test runs in debug mode

Actual behaviour

When "Debug Test" is selected from within the editor above a unittest the known error message from #3330 is shown

Steps to reproduce:

  • install anaconda
  • create py3.6 and py3.7 environments
  • install vscode, python extension
  • open a folder of a python project using numpy with testing, enable testing, select the environment and click "Debug Test" above a test method of a test case from within the editor.

Logs

============================= test session starts =============================
platform win32 -- Python 3.7.1, pytest-4.2.0, py-1.7.0, pluggy-0.8.1
benchmark: 3.2.2 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: c:\project, inifile:
plugins: cov-2.6.1, benchmark-3.2.2
=================================== ERRORS ====================================
__________________ ERROR collecting tests/test_data_prep.py ___________________
ImportError while importing test module 'c:\project\tests\test_data_prep.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
C:\Users\XXXXX\AppData\Local\Continuum\anaconda3\envs\project\lib\site-packages\numpy\core\__init__.py:16: in <module>
    from . import multiarray
E   ImportError: DLL load failed: Das angegebene Modul wurde nicht gefunden.
During handling of the above exception, another exception occurred:
tests\test_data_prep.py:1: in <module>
    import numpy as np
C:\Users\XXXXX\AppData\Local\Continuum\anaconda3\envs\project\lib\site-packages\numpy\__init__.py:142: in <module>
    from . import add_newdocs
C:\Users\XXXXX\AppData\Local\Continuum\anaconda3\envs\project\lib\site-packages\numpy\add_newdocs.py:13: in <module>
    from numpy.lib import add_newdoc
C:\Users\XXXXX\AppData\Local\Continuum\anaconda3\envs\project\lib\site-packages\numpy\lib\__init__.py:8: in <module>
    from .type_check import ...
 generated xml file: C:\Users\XXXXX\AppData\Local\Temp\tmp-10040Ua1sUDOhID1o.xml 
=========================== 1 error in 0.27 seconds ===========================
ERROR: not found: c:\project\tests\test_data_prep.py::TestCustomFeautures::test_compare_name_email
(no name 'c:\\project\\tests\\test_data_prep.py::TestCustomFeautures::test_compare_name_email' in any of [<Module test_data_prep.py>])
@ghost ghost added the triage-needed Needs assignment to the proper sub-team label Feb 6, 2019
@d3r3kk d3r3kk self-assigned this Feb 6, 2019
@d3r3kk d3r3kk added the triage label Feb 6, 2019
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Feb 6, 2019
@d3r3kk d3r3kk added bug Issue identified by VS Code Team member as probable bug needs PR area-testing and removed triage labels Feb 6, 2019
@d3r3kk d3r3kk removed their assignment Feb 6, 2019
@DonJayamanne
Copy link

@mbunse Does it work for you when no run the code without debugging?

@mbunse
Copy link
Author

mbunse commented Feb 6, 2019

Yes. Clicking "Run Test" works as expected.

@d3r3kk
Copy link

d3r3kk commented Feb 7, 2019

I can reproduce this locally on Windows 10, with the following repo sample:

4300_conda_debug_tests_with_numpy.zip

  1. Unzip this to a location on your local disk
  2. Open the Anaconda Prompt and create an environment like so: conda create -n 4300 pylint numpy pytest autopep8
  3. Open VS Code and install the Python extension
  4. Open the workspace you unzipped previously
  5. Select the "Conda 4300" interpreter in the status bar
  6. Run all ests, see that they all complete successfully.
  7. Using the code lens appearing at the top of the test method test_compare_name_email click Run Test. Observe that it completes successfully.
  8. Using the code lens again, but clicking Debug Test, observe the failure.

Resulting screen

image

Output :: Python Test

============================= test session starts =============================
platform win32 -- Python 3.7.2, pytest-4.2.0, py-1.7.0, pluggy-0.8.1
rootdir: d:\dev\github\d3r3kk\test\4300_conda_debug_tests_with_numpy, inifile:
collected 1 item
<Module tests/test_data_prep.py>
  <UnitTestCase TestCustomFeautures>
    <TestCaseFunction test_compare_name_email>

======================== no tests ran in 1.46 seconds =========================

Debug Console

============================= test session starts =============================
platform win32 -- Python 3.7.2, pytest-4.2.0, py-1.7.0, pluggy-0.8.1
rootdir: d:\dev\github\d3r3kk\test\4300_conda_debug_tests_with_numpy, inifile:

=================================== ERRORS ====================================
__________________ ERROR collecting tests/test_data_prep.py ___________________
ImportError while importing test module 'd:\dev\github\username\test\4300_conda_debug_tests_with_numpy\tests\test_data_prep.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
C:\Python\Versions\Miniconda3\envs\4300\lib\site-packages\numpy\core\__init__.py:16: in <module>
    from . import multiarray
E   ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:
tests\test_data_prep.py:3: in <module>
    import numpy as np
C:\Python\Versions\Miniconda3\envs\4300\lib\site-packages\numpy\__init__.py:142: in <module>
    from . import add_newdocs
C:\Python\Versions\Miniconda3\envs\4300\lib\site-packages\numpy\add_newdocs.py:13: in <module>
    from numpy.lib import add_newdoc
C:\Python\Versions\Miniconda3\envs\4300\lib\site-packages\numpy\lib\__init__.py:8: in <module>
    from .type_check import *
C:\Python\Versions\Miniconda3\envs\4300\lib\site-packages\numpy\lib\type_check.py:...
 generated xml file: C:\Users\username\AppData\Local\Temp\tmp-6680B33elgDHh68c.xml 
=========================== 1 error in 0.40 seconds ===========================
ERROR: not found: d:\dev\github\username\test\4300_conda_debug_tests_with_numpy\tests\test_data_prep.py::TestCustomFeautures::test_compare_name_email
(no name 'd:\\dev\\github\\username\\test\\4300_conda_debug_tests_with_numpy\\tests\\test_data_prep.py::TestCustomFeautures::test_compare_name_email' in any of [<Module tests/test_data_prep.py>])

Developer Tools Window

Click to expand...
log.ts:157  INFO no standard startup: not a new window
extensionHost.ts:329 [Extension Host] debugger listening on port 10853
extensionHost.ts:235 Extension Host
extensionHost.ts:236 Debugger listening on ws://127.0.0.1:10853/23a3f800-f06f-41c2-80dd-d096c73c8cd9
For help see https://nodejs.org/en/docs/inspector

console.ts:134 [Extension Host] [UriError]: Scheme is missing: {scheme: "", authority: "", path: "", query: "", fragment: ""}
t.log @ console.ts:134
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: false
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Class name = p, Arg 1: {}, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: false
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Class name = p, Arg 1: {}, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: false
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Class name = p, Arg 1: {}, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: false
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Class name = p, Arg 1: {}, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: false
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Class name = p, Arg 1: {}, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Create file systemwatcher with pattern *\python.exe
console.ts:134 [Extension Host] Python Extension: Create file systemwatcher with pattern *\*\python.exe
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: false
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Class name = p, Arg 1: {}, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: false
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Class name = p, Arg 1: {}, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: false
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Class name = p, Arg 1: {}, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Register Intepreter Watcher, Class name = f, Arg 1: <Uri:d:\dev\github\username\test\4300_conda_debug_tests_with_numpy\tests\test_data_prep.py>, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Build the workspace interpreter watcher, Class name = h, Arg 1: <Uri:d:\dev\github\username\test\4300_conda_debug_tests_with_numpy\tests\test_data_prep.py>, Return Value: <Return value cannot be serialized for logging>
console.ts:134 [Extension Host] Python Extension: Detection of Python Interpreter for Command python3.7 and args  failed
console.ts:134 [Extension Host] Python Extension: Detection of Python Interpreter for Command python3.6 and args  failed
console.ts:134 [Extension Host] Python Extension: Detection of Python Interpreter for Command python3 and args  failed
console.ts:134 [Extension Host] Python Extension: Detection of Python Interpreter for Command python2 and args  failed
console.ts:134 [Extension Host] Python Extension: Rule = settings, result = runNextRule
console.ts:134 [Extension Host] Python Extension: Executing next rule from settings
console.ts:134 [Extension Host] Python Extension: Rule = workspaceEnvs, result = runNextRule
console.ts:134 [Extension Host] Python Extension: Executing next rule from workspaceEnvs
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, <No Resource>
console.ts:134 [Extension Host] Python Extension: Current value for rule system is {"architecture":3,"path":"C:\\Python\\Versions\\Miniconda3\\envs\\4300\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python\\Versions\\Miniconda3\\envs\\4300","fileHash":"e57893926b74046131779051b9b0e497710f0b8588e4b57c376e568ac3cb7bfa5fb840cfa84027e440fa27cb9cd07806d6882d1e3c12112a9968520dd3d1f6c3","companyDisplayName":"Anaconda, Inc.","type":"Conda","envPath":"C:\\Python\\Versions\\Miniconda3\\envs\\4300","envName":"4300","displayName":"Python 3.7.2 64-bit ('4300': conda)"}
console.ts:134 [Extension Host] Python Extension: Current value for rule currentPath is {"architecture":3,"path":"C:\\Python\\Versions\\3.7.0\\python.exe","version":{"raw":"3.7.0-final","major":3,"minor":7,"patch":0,"prerelease":["final"],"build":[],"version":"3.7.0-final"},"sysPrefix":"C:\\Python\\Versions\\3.7.0","fileHash":"ed07b626cfa38b9b362e6231b1dced9d1b02aa0d867758045d3d9808c0a40159a78fecc71d390536dd234b89cb877b3bd99dd898c8e6d7e76635837e99475a55","type":"Unknown"}
console.ts:134 [Extension Host] Python Extension: Current value for rule windowsRegistry is {"architecture":3,"path":"C:\\Python\\Versions\\Miniconda3\\python.exe","version":{"raw":"3.7.1-final","major":3,"minor":7,"patch":1,"prerelease":["final"],"build":[],"version":"3.7.1-final"},"sysPrefix":"C:\\Python\\Versions\\Miniconda3","fileHash":"4fd6083349e0e0e644d6f792b16c5466d623dc7acfe1e5e4e08e7519e60858f790d778e730702d7fa0024c92e126347ec334524577a1ee7b525eac9b68f7aaa0","companyDisplayName":"Anaconda, Inc.","type":"Unknown"}
console.ts:134 [Extension Host] Python Extension: Selected Interpreter from cachedInterpreters, {"architecture":3,"path":"C:\\Python\\Versions\\Miniconda3\\envs\\4300\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python\\Versions\\Miniconda3\\envs\\4300","fileHash":"e57893926b74046131779051b9b0e497710f0b8588e4b57c376e568ac3cb7bfa5fb840cfa84027e440fa27cb9cd07806d6882d1e3c12112a9968520dd3d1f6c3","companyDisplayName":"Anaconda, Inc.","type":"Conda","envPath":"C:\\Python\\Versions\\Miniconda3\\envs\\4300","envName":"4300","displayName":"Python 3.7.2 64-bit ('4300': conda)"}
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, <No Resource>
console.ts:134 [Extension Host] Python Extension: Interpreters returned by PipEnvService are of count 0
console.ts:134 [Extension Host] Python Extension: Interpreters returned by VirtualEnvService are of count 0
console.ts:134 [Extension Host] Python Extension: Interpreters returned by WorkspaceVirtualEnvService are of count 0
console.ts:134 [Extension Host] Python Extension: Interpreters returned by KnownPathsService are of count 1
console.ts:134 [Extension Host] Python Extension: Interpreters returned by CurrentPathService are of count 6
console.ts:134 [Extension Host] Python Extension: setGlobalInterpreter, Class name = g, Arg 1: {"architecture":3,"path":"C:\\Python\\Versions\\Miniconda3\\envs\\4300\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python\\Versions\\Miniconda3\\envs\\4300","fileHash":"e57893926b74046131779051b9b0e497710f0b8588e4b57c376e568ac3cb7bfa5fb840cfa84027e440fa27cb9cd07806d6882d1e3c12112a9968520dd3d1f6c3","companyDisplayName":"Anaconda, Inc.","type":"Conda","envPath":"C:\\Python\\Versions\\Miniconda3\\envs\\4300","envName":"4300","displayName":"Python 3.7.2 64-bit ('4300': conda)"}, Arg 2: <argument cannot be serialized for logging>, Return Value: true
console.ts:134 [Extension Host] Python Extension: Rule = cachedInterpreters, result = exit
console.ts:134 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: <Uri:d:\dev\github\username\test\4300_conda_debug_tests_with_numpy>, Arg 2: <argument cannot be serialized for logging>, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: <Uri:d:\dev\github\username\test\4300_conda_debug_tests_with_numpy>, Arg 2: <argument cannot be serialized for logging>, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: <Uri:d:\dev\github\username\test\4300_conda_debug_tests_with_numpy>, Arg 2: <argument cannot be serialized for logging>, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, d:\dev\github\username\test\4300_conda_debug_tests_with_numpy
console.ts:134 [Extension Host] Python Extension: Rule = settings, result = runNextRule
console.ts:134 [Extension Host] Python Extension: Executing next rule from settings
console.ts:134 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: <Uri:d:\dev\github\username\test\4300_conda_debug_tests_with_numpy>, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Selected Interpreter from windowsRegistry, {"architecture":3,"path":"C:\\Python\\Versions\\Miniconda3\\python.exe","version":{"raw":"3.7.1-final","major":3,"minor":7,"patch":1,"prerelease":["final"],"build":[],"version":"3.7.1-final"},"sysPrefix":"C:\\Python\\Versions\\Miniconda3","fileHash":"4fd6083349e0e0e644d6f792b16c5466d623dc7acfe1e5e4e08e7519e60858f790d778e730702d7fa0024c92e126347ec334524577a1ee7b525eac9b68f7aaa0","companyDisplayName":"Anaconda, Inc.","type":"Unknown","cachedEntry":true}
console.ts:134 [Extension Host] Python Extension: Rule = workspaceEnvs, result = runNextRule
console.ts:134 [Extension Host] Python Extension: Executing next rule from workspaceEnvs
console.ts:134 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: <Uri:d:\dev\github\username\test\4300_conda_debug_tests_with_numpy>, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Selected Interpreter from currentPath, {"architecture":3,"path":"C:\\Python\\Versions\\Miniconda3\\envs\\4300\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python\\Versions\\Miniconda3\\envs\\4300","fileHash":"e57893926b74046131779051b9b0e497710f0b8588e4b57c376e568ac3cb7bfa5fb840cfa84027e440fa27cb9cd07806d6882d1e3c12112a9968520dd3d1f6c3","type":"Unknown"}
console.ts:134 [Extension Host] Python Extension: Current value for rule system is {"architecture":3,"path":"C:\\Python\\Versions\\Miniconda3\\envs\\4300\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python\\Versions\\Miniconda3\\envs\\4300","fileHash":"e57893926b74046131779051b9b0e497710f0b8588e4b57c376e568ac3cb7bfa5fb840cfa84027e440fa27cb9cd07806d6882d1e3c12112a9968520dd3d1f6c3","companyDisplayName":"Anaconda, Inc.","type":"Conda","envPath":"C:\\Python\\Versions\\Miniconda3\\envs\\4300","envName":"4300","displayName":"Python 3.7.2 64-bit ('4300': conda)"}
console.ts:134 [Extension Host] Python Extension: Current value for rule currentPath is {"architecture":3,"path":"C:\\Python\\Versions\\Miniconda3\\envs\\4300\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python\\Versions\\Miniconda3\\envs\\4300","fileHash":"e57893926b74046131779051b9b0e497710f0b8588e4b57c376e568ac3cb7bfa5fb840cfa84027e440fa27cb9cd07806d6882d1e3c12112a9968520dd3d1f6c3","type":"Unknown"}
console.ts:134 [Extension Host] Python Extension: Current value for rule windowsRegistry is {"architecture":3,"path":"C:\\Python\\Versions\\Miniconda3\\python.exe","version":{"raw":"3.7.1-final","major":3,"minor":7,"patch":1,"prerelease":["final"],"build":[],"version":"3.7.1-final"},"sysPrefix":"C:\\Python\\Versions\\Miniconda3","fileHash":"4fd6083349e0e0e644d6f792b16c5466d623dc7acfe1e5e4e08e7519e60858f790d778e730702d7fa0024c92e126347ec334524577a1ee7b525eac9b68f7aaa0","companyDisplayName":"Anaconda, Inc.","type":"Unknown","cachedEntry":true}
console.ts:134 [Extension Host] Python Extension: Selected Interpreter from cachedInterpreters, {"architecture":3,"path":"C:\\Python\\Versions\\Miniconda3\\envs\\4300\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python\\Versions\\Miniconda3\\envs\\4300","fileHash":"e57893926b74046131779051b9b0e497710f0b8588e4b57c376e568ac3cb7bfa5fb840cfa84027e440fa27cb9cd07806d6882d1e3c12112a9968520dd3d1f6c3","type":"Unknown"}
console.ts:134 [Extension Host] Python Extension: Get language server folder name, Class name = g, , Return Value: "languageServer.0.1.78"
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Selected Interpreter from system, {"architecture":3,"path":"C:\\Python\\Versions\\Miniconda3\\envs\\4300\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python\\Versions\\Miniconda3\\envs\\4300","fileHash":"e57893926b74046131779051b9b0e497710f0b8588e4b57c376e568ac3cb7bfa5fb840cfa84027e440fa27cb9cd07806d6882d1e3c12112a9968520dd3d1f6c3","companyDisplayName":"Anaconda, Inc.","type":"Conda","envPath":"C:\\Python\\Versions\\Miniconda3\\envs\\4300","envName":"4300","cachedEntry":true,"displayName":"Python 3.7.2 64-bit ('4300': conda)"}
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Get language server folder name, Class name = g, , Return Value: "languageServer.0.1.78"
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, d:\dev\github\username\test\4300_conda_debug_tests_with_numpy
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, d:\dev\github\username\test\4300_conda_debug_tests_with_numpy\tests\test_data_prep.py
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: setGlobalInterpreter, Class name = g, Arg 1: {"architecture":3,"path":"C:\\Python\\Versions\\Miniconda3\\python.exe","version":{"raw":"3.7.1-final","major":3,"minor":7,"patch":1,"prerelease":["final"],"build":[],"version":"3.7.1-final"},"sysPrefix":"C:\\Python\\Versions\\Miniconda3","fileHash":"4fd6083349e0e0e644d6f792b16c5466d623dc7acfe1e5e4e08e7519e60858f790d778e730702d7fa0024c92e126347ec334524577a1ee7b525eac9b68f7aaa0","companyDisplayName":"Anaconda, Inc.","type":"Unknown","cachedEntry":true}, Arg 2: undefined, Return Value: false
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: setGlobalInterpreter, Class name = g, Arg 1: {"architecture":3,"path":"C:\\Python\\Versions\\Miniconda3\\envs\\4300\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python\\Versions\\Miniconda3\\envs\\4300","fileHash":"e57893926b74046131779051b9b0e497710f0b8588e4b57c376e568ac3cb7bfa5fb840cfa84027e440fa27cb9cd07806d6882d1e3c12112a9968520dd3d1f6c3","type":"Unknown"}, Arg 2: undefined, Return Value: false
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: setGlobalInterpreter, Class name = g, Arg 1: {"architecture":3,"path":"C:\\Python\\Versions\\Miniconda3\\envs\\4300\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python\\Versions\\Miniconda3\\envs\\4300","fileHash":"e57893926b74046131779051b9b0e497710f0b8588e4b57c376e568ac3cb7bfa5fb840cfa84027e440fa27cb9cd07806d6882d1e3c12112a9968520dd3d1f6c3","type":"Unknown"}, Arg 2: undefined, Return Value: false
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Rule = windowsRegistry, result = runNextRule
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Executing next rule from windowsRegistry
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Rule = currentPath, result = runNextRule
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Executing next rule from currentPath
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Rule = cachedInterpreters, result = runNextRule
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Executing next rule from cachedInterpreters
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: <Uri:d:\dev\github\username\test\4300_conda_debug_tests_with_numpy>, Return Value: undefined
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: <Uri:d:\dev\github\username\test\4300_conda_debug_tests_with_numpy>, Return Value: undefined
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: <Uri:d:\dev\github\username\test\4300_conda_debug_tests_with_numpy>, Return Value: undefined
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: setGlobalInterpreter, Class name = g, Arg 1: {"architecture":3,"path":"C:\\Python\\Versions\\Miniconda3\\envs\\4300\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python\\Versions\\Miniconda3\\envs\\4300","fileHash":"e57893926b74046131779051b9b0e497710f0b8588e4b57c376e568ac3cb7bfa5fb840cfa84027e440fa27cb9cd07806d6882d1e3c12112a9968520dd3d1f6c3","companyDisplayName":"Anaconda, Inc.","type":"Conda","envPath":"C:\\Python\\Versions\\Miniconda3\\envs\\4300","envName":"4300","cachedEntry":true,"displayName":"Python 3.7.2 64-bit ('4300': conda)"}, Arg 2: undefined, Return Value: false
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Rule = system, result = runNextRule
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Executing next rule from system
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: <Uri:d:\dev\github\username\test\4300_conda_debug_tests_with_numpy>, Return Value: undefined
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, <No Resource>
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Get language server folder name, Class name = g, , Return Value: "languageServer.0.1.78"
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, <No Resource>
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Interpreters returned by CondaEnvFileService are of count 4
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Interpreters returned by WindowsRegistryService are of count 5
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: false
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Interpreters returned by CondaEnvService are of count 6
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: true
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Hide locator refreshing progress, Class name = p, , Return Value: undefined
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: All locators have completed locating, Class name = p, , Return Value: undefined
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, d:\dev\github\username\test\4300_conda_debug_tests_with_numpy
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Starting Language Server, Class name = r, , Return Value: undefined
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, d:\dev\github\username\test\4300_conda_debug_tests_with_numpy\tests\test_data_prep.py
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, <No Resource>
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, <No Resource>
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Rule = settings, result = runNextRule
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Executing next rule from settings
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Rule = workspaceEnvs, result = runNextRule
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Executing next rule from workspaceEnvs
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Current value for rule system is {"architecture":3,"path":"C:\\Python\\Versions\\Miniconda3\\envs\\4300\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python\\Versions\\Miniconda3\\envs\\4300","fileHash":"e57893926b74046131779051b9b0e497710f0b8588e4b57c376e568ac3cb7bfa5fb840cfa84027e440fa27cb9cd07806d6882d1e3c12112a9968520dd3d1f6c3","companyDisplayName":"Anaconda, Inc.","type":"Conda","envPath":"C:\\Python\\Versions\\Miniconda3\\envs\\4300","envName":"4300","cachedEntry":true,"displayName":"Python 3.7.2 64-bit ('4300': conda)"}
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Current value for rule currentPath is {"architecture":3,"path":"C:\\Python\\Versions\\Miniconda3\\envs\\4300\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python\\Versions\\Miniconda3\\envs\\4300","fileHash":"e57893926b74046131779051b9b0e497710f0b8588e4b57c376e568ac3cb7bfa5fb840cfa84027e440fa27cb9cd07806d6882d1e3c12112a9968520dd3d1f6c3","type":"Unknown"}
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Current value for rule windowsRegistry is {"architecture":3,"path":"C:\\Python\\Versions\\Miniconda3\\python.exe","version":{"raw":"3.7.1-final","major":3,"minor":7,"patch":1,"prerelease":["final"],"build":[],"version":"3.7.1-final"},"sysPrefix":"C:\\Python\\Versions\\Miniconda3","fileHash":"4fd6083349e0e0e644d6f792b16c5466d623dc7acfe1e5e4e08e7519e60858f790d778e730702d7fa0024c92e126347ec334524577a1ee7b525eac9b68f7aaa0","companyDisplayName":"Anaconda, Inc.","type":"Unknown","cachedEntry":true}
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Selected Interpreter from cachedInterpreters, {"architecture":3,"path":"C:\\Python\\Versions\\Miniconda3\\envs\\4300\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python\\Versions\\Miniconda3\\envs\\4300","fileHash":"e57893926b74046131779051b9b0e497710f0b8588e4b57c376e568ac3cb7bfa5fb840cfa84027e440fa27cb9cd07806d6882d1e3c12112a9968520dd3d1f6c3","type":"Unknown"}
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: setGlobalInterpreter, Class name = g, Arg 1: {"architecture":3,"path":"C:\\Python\\Versions\\Miniconda3\\envs\\4300\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python\\Versions\\Miniconda3\\envs\\4300","fileHash":"e57893926b74046131779051b9b0e497710f0b8588e4b57c376e568ac3cb7bfa5fb840cfa84027e440fa27cb9cd07806d6882d1e3c12112a9968520dd3d1f6c3","type":"Unknown"}, Arg 2: <argument cannot be serialized for logging>, Return Value: true
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Rule = cachedInterpreters, result = exit
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: undefined, Arg 2: <argument cannot be serialized for logging>, Return Value: undefined
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: undefined, Arg 2: <argument cannot be serialized for logging>, Return Value: undefined
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: undefined, Arg 2: <argument cannot be serialized for logging>, Return Value: undefined
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Rule = settings, result = runNextRule
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Executing next rule from settings
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, <No Resource>
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, <No Resource>
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: undefined, Return Value: undefined
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, <No Resource>
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Selected Interpreter from windowsRegistry, {"architecture":3,"path":"C:\\Python\\Versions\\Miniconda3\\python.exe","version":{"raw":"3.7.1-final","major":3,"minor":7,"patch":1,"prerelease":["final"],"build":[],"version":"3.7.1-final"},"sysPrefix":"C:\\Python\\Versions\\Miniconda3","fileHash":"4fd6083349e0e0e644d6f792b16c5466d623dc7acfe1e5e4e08e7519e60858f790d778e730702d7fa0024c92e126347ec334524577a1ee7b525eac9b68f7aaa0","companyDisplayName":"Anaconda, Inc.","type":"Unknown"}
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Selected Interpreter from currentPath, {"architecture":3,"path":"C:\\Python\\Versions\\Miniconda3\\envs\\4300\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python\\Versions\\Miniconda3\\envs\\4300","fileHash":"e57893926b74046131779051b9b0e497710f0b8588e4b57c376e568ac3cb7bfa5fb840cfa84027e440fa27cb9cd07806d6882d1e3c12112a9968520dd3d1f6c3","type":"Unknown"}
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Current value for rule system is {"architecture":3,"path":"C:\\Python\\Versions\\Miniconda3\\envs\\4300\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python\\Versions\\Miniconda3\\envs\\4300","fileHash":"e57893926b74046131779051b9b0e497710f0b8588e4b57c376e568ac3cb7bfa5fb840cfa84027e440fa27cb9cd07806d6882d1e3c12112a9968520dd3d1f6c3","companyDisplayName":"Anaconda, Inc.","type":"Conda","envPath":"C:\\Python\\Versions\\Miniconda3\\envs\\4300","envName":"4300","cachedEntry":true,"displayName":"Python 3.7.2 64-bit ('4300': conda)"}
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Current value for rule currentPath is {"architecture":3,"path":"C:\\Python\\Versions\\Miniconda3\\envs\\4300\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python\\Versions\\Miniconda3\\envs\\4300","fileHash":"e57893926b74046131779051b9b0e497710f0b8588e4b57c376e568ac3cb7bfa5fb840cfa84027e440fa27cb9cd07806d6882d1e3c12112a9968520dd3d1f6c3","type":"Unknown"}
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Current value for rule windowsRegistry is {"architecture":3,"path":"C:\\Python\\Versions\\Miniconda3\\python.exe","version":{"raw":"3.7.1-final","major":3,"minor":7,"patch":1,"prerelease":["final"],"build":[],"version":"3.7.1-final"},"sysPrefix":"C:\\Python\\Versions\\Miniconda3","fileHash":"4fd6083349e0e0e644d6f792b16c5466d623dc7acfe1e5e4e08e7519e60858f790d778e730702d7fa0024c92e126347ec334524577a1ee7b525eac9b68f7aaa0","companyDisplayName":"Anaconda, Inc.","type":"Unknown"}
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Selected Interpreter from cachedInterpreters, {"architecture":3,"path":"C:\\Python\\Versions\\Miniconda3\\envs\\4300\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python\\Versions\\Miniconda3\\envs\\4300","fileHash":"e57893926b74046131779051b9b0e497710f0b8588e4b57c376e568ac3cb7bfa5fb840cfa84027e440fa27cb9cd07806d6882d1e3c12112a9968520dd3d1f6c3","type":"Unknown"}
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Display locator refreshing progress, Class name = p, , Return Value: undefined
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Notify locators are locating, Class name = p, , Return Value: undefined
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: false
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Detected refreshing of Interpreters, Class name = p, Arg 1: {}, Return Value: undefined
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Create file systemwatcher with pattern *\python.exe
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Create file systemwatcher with pattern *\*\python.exe
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Display locator refreshing progress, Class name = p, , Return Value: undefined
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Notify locators are locating, Class name = p, , Return Value: undefined
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: false
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Detected refreshing of Interpreters, Class name = p, Arg 1: {}, Return Value: undefined
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Register Intepreter Watcher, Class name = f, Arg 1: undefined, Return Value: undefined
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Build the workspace interpreter watcher, Class name = h, Arg 1: undefined, Return Value: <Return value cannot be serialized for logging>
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Rule = workspaceEnvs, result = runNextRule
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Executing next rule from workspaceEnvs
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: undefined, Return Value: undefined
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Selected Interpreter from system, {"architecture":3,"path":"C:\\Python\\Versions\\Miniconda3\\envs\\4300\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python\\Versions\\Miniconda3\\envs\\4300","fileHash":"e57893926b74046131779051b9b0e497710f0b8588e4b57c376e568ac3cb7bfa5fb840cfa84027e440fa27cb9cd07806d6882d1e3c12112a9968520dd3d1f6c3","companyDisplayName":"Anaconda, Inc.","type":"Conda","envPath":"C:\\Python\\Versions\\Miniconda3\\envs\\4300","envName":"4300","displayName":"Python 3.7.2 64-bit ('4300': conda)"}
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: setGlobalInterpreter, Class name = g, Arg 1: {"architecture":3,"path":"C:\\Python\\Versions\\Miniconda3\\python.exe","version":{"raw":"3.7.1-final","major":3,"minor":7,"patch":1,"prerelease":["final"],"build":[],"version":"3.7.1-final"},"sysPrefix":"C:\\Python\\Versions\\Miniconda3","fileHash":"4fd6083349e0e0e644d6f792b16c5466d623dc7acfe1e5e4e08e7519e60858f790d778e730702d7fa0024c92e126347ec334524577a1ee7b525eac9b68f7aaa0","companyDisplayName":"Anaconda, Inc.","type":"Unknown"}, Arg 2: undefined, Return Value: false
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: setGlobalInterpreter, Class name = g, Arg 1: {"architecture":3,"path":"C:\\Python\\Versions\\Miniconda3\\envs\\4300\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python\\Versions\\Miniconda3\\envs\\4300","fileHash":"e57893926b74046131779051b9b0e497710f0b8588e4b57c376e568ac3cb7bfa5fb840cfa84027e440fa27cb9cd07806d6882d1e3c12112a9968520dd3d1f6c3","type":"Unknown"}, Arg 2: undefined, Return Value: false
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: setGlobalInterpreter, Class name = g, Arg 1: {"architecture":3,"path":"C:\\Python\\Versions\\Miniconda3\\envs\\4300\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python\\Versions\\Miniconda3\\envs\\4300","fileHash":"e57893926b74046131779051b9b0e497710f0b8588e4b57c376e568ac3cb7bfa5fb840cfa84027e440fa27cb9cd07806d6882d1e3c12112a9968520dd3d1f6c3","type":"Unknown"}, Arg 2: undefined, Return Value: false
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Rule = windowsRegistry, result = runNextRule
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Executing next rule from windowsRegistry
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Rule = currentPath, result = runNextRule
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Executing next rule from currentPath
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Rule = cachedInterpreters, result = runNextRule
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Executing next rule from cachedInterpreters
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: undefined, Return Value: undefined
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: undefined, Return Value: undefined
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: undefined, Return Value: undefined
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Interpreters returned by PipEnvService are of count 0
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Interpreters returned by WorkspaceVirtualEnvService are of count 0
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: setGlobalInterpreter, Class name = g, Arg 1: {"architecture":3,"path":"C:\\Python\\Versions\\Miniconda3\\envs\\4300\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python\\Versions\\Miniconda3\\envs\\4300","fileHash":"e57893926b74046131779051b9b0e497710f0b8588e4b57c376e568ac3cb7bfa5fb840cfa84027e440fa27cb9cd07806d6882d1e3c12112a9968520dd3d1f6c3","companyDisplayName":"Anaconda, Inc.","type":"Conda","envPath":"C:\\Python\\Versions\\Miniconda3\\envs\\4300","envName":"4300","displayName":"Python 3.7.2 64-bit ('4300': conda)"}, Arg 2: undefined, Return Value: false
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Rule = system, result = runNextRule
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Executing next rule from system
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: true
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Hide locator refreshing progress, Class name = p, , Return Value: undefined
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: All locators have completed locating, Class name = p, , Return Value: undefined
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: undefined, Return Value: undefined
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Current value for rule workspaceEnvs is {"architecture":3,"path":"d:\\dev\\github\\username\\pytest\\.venv\\Scripts\\python.exe","version":{"raw":"3.7.0-final","major":3,"minor":7,"patch":0,"prerelease":["final"],"build":[],"version":"3.7.0-final"},"sysPrefix":"d:\\dev\\github\\username\\pytest\\.venv","fileHash":"5d1b76c89a37978bc49f9e85134125410430bae1829f391aa802ee309e445079982a46d71ab04efa044bf53f5f9573ad8ce65018d8e0c42fa50dca7e8c6ed21f","envName":".venv","type":"Venv"}
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Current value for rule workspaceEnvs is {"architecture":3,"path":"d:\\dev\\github\\username\\pytest\\.venv\\Scripts\\python.exe","version":{"raw":"3.7.0-final","major":3,"minor":7,"patch":0,"prerelease":["final"],"build":[],"version":"3.7.0-final"},"sysPrefix":"d:\\dev\\github\\username\\pytest\\.venv","fileHash":"5d1b76c89a37978bc49f9e85134125410430bae1829f391aa802ee309e445079982a46d71ab04efa044bf53f5f9573ad8ce65018d8e0c42fa50dca7e8c6ed21f","envName":".venv","type":"Venv"}
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Activation Commands received C:/Python/Versions/Miniconda3/Scripts/activate,conda activate 4300
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, d:\dev\github\username\test\4300_conda_debug_tests_with_numpy
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, d:\dev\github\username\test\4300_conda_debug_tests_with_numpy
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Has Custom Env Vars
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Activating Environment to capture Environment variables, C:/Python/Versions/Miniconda3/Scripts/activate && conda activate 4300 && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python C:/Users/username/.vscode/extensions/ms-python.python-2019.1.0/pythonFiles/printEnvVariables.py
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: parseEnvironmentOutput, Class name = S
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: getActivatedEnvironmentVariables, Class name = S, Arg 1: <Uri:d:\dev\github\username\test\4300_conda_debug_tests_with_numpy>, Arg 2: undefined
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, c:\Users\username\.vscode\extensions\ms-python.python-2019.1.0\pythonFiles\testlauncher.py
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, d:\dev\github\username\test\4300_conda_debug_tests_with_numpy
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Cached data exists ActivatedEnvironmentVariables, d:\dev\github\username\test\4300_conda_debug_tests_with_numpy
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: getActivatedEnvironmentVariables, Class name = S, Arg 1: <Uri:d:\dev\github\username\test\4300_conda_debug_tests_with_numpy>, Arg 2: undefined
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, d:\dev\github\username\test\4300_conda_debug_tests_with_numpy
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, <No Resource>
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, <No Resource>
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, c:\Users\username\.vscode\extensions\ms-python.python-2019.1.0\pythonFiles\testlauncher.py
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, d:\dev\github\username\test\4300_conda_debug_tests_with_numpy
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, extension-output-#4
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, extension-output-#5
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, d:\dev\github\username\test\4300_conda_debug_tests_with_numpy

@cpaulik
Copy link

cpaulik commented Mar 20, 2019

We have a similar issue that during debugging of a script the conda environment is not activated before the script is started in debug mode. Similar to #2862 but in cmd.exe

It works if the debugging is started a second time using the same internal terminal. Then the conda environment is activated before running the script in debug mode.

I can open a new issue but they all seem to have a similar cause

@RoyLarson
Copy link

Does this have to do with the below numpy issue?
numpy/numpy#12736

@gordonwatts
Copy link

I see the same error (on a fresh install of everything as well). This is not likely due to the numpy error.

@DonJayamanne
Copy link

Please could you provide the following info:

  • Version of the Python extension
  • Version of Python & type of environment (Conda, etc)
  • Sample python code used to test (please provide a very simple block of code)

@DonJayamanne DonJayamanne added the info-needed Issue requires more information from poster label Apr 18, 2019
@Zhi-Liu
Copy link

Zhi-Liu commented Apr 24, 2019

I have the same issue: python 2019.4.1.11881,conda 4.5.11
test_example.py:

from flask import request
from pytest import fixture, raises, mark, param

class TestExample:
    def test_bug_repro(self):
        i = 5
        assert i == 5

errors:

============================= test session starts =============================

platform win32 -- Python 3.7.3, pytest-4.4.1, py-1.8.0, pluggy-0.9.0 -- C:\Users\...\AppData\Local\Continuum\miniconda3\envs\pytorch\python.exe

cachedir: .pytest_cache

rootdir: c:\Users\...

collecting ...

=================================== ERRORS ====================================

___________________ ERROR collecting tests/test_example.py ____________________

ImportError while importing test module 'c:\Users\...\tests\test_example.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
tests\test_example.py:1: in <module>
    from flask import request
..\..\..\..\..\AppData\Local\Continuum\miniconda3\envs\pytorch\lib\site-packages\flask\__init__.py:21: in <module>
    from .app import Flask, Request, Response
..\..\..\..\..\AppData\Local\Continuum\miniconda3\envs\pytorch\lib\site-packages\flask\app.py:25: in <module>
    from . import cli, json
..\..\..\..\..\AppData\Local\Continuum\miniconda3\envs\pytorch\lib\site-packages\flask\cli.py:18: in <module>
    import ssl
..\..\..\..\..\AppData\Local\Continuum\miniconda3\envs\pytorch\lib\ssl.py:98: in <module>
    import _ssl             # if we can't import it, let the error propagate
E   ImportError: DLL load failed: The specified module could not be found.

......
===================== 2 warnings, 1 error in 0.50 seconds =====================

ERROR: not found: c:\Users\...\tests\test_example.py::TestExample
(no name 'c:\\Users\\...\\tests\\test_example.py::TestExample' in any of [<Module test_example.py>])

@DonJayamanne
Copy link

@Zhi-Liu Please could you check your Console window (Help-> Toggle Developer Tools) and check if there are any errors in there.

@dennispg
Copy link

I am able to reproduce this with a completely empty workspace and a brand new fresh conda environment.

  • VS Code version: 1.34.0
  • Extension version (available under the Extensions sidebar): 2019.4.12954
  • OS and version: Windows 10 1803
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.7.3, anaconda
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda 4.6.14
  • Relevant/affected Python packages and their versions: numpy 1.16.3

environment.yml :

name: vscode-pytest-conda
channels:
  - defaults
dependencies:
  - python==3.7.3
  - pytest==4.5.0
  - numpy==1.16.3

tests/conftest.py :

import numpy

Python Test Log (after trying to collect tests)

ImportError while loading conftest '.\vscode-py\tests\conftest.py'.
tests\conftest.py:1: in <module>
    import numpy
..\..\AppData\Local\Continuum\Miniconda3\envs\vscode-pytest-conda\lib\site-packages\numpy\__init__.py:140: in <module>
    from . import _distributor_init
..\..\AppData\Local\Continuum\Miniconda3\envs\vscode-pytest-conda\lib\site-packages\numpy\_distributor_init.py:34: in <module>
    from . import _mklinit
E   ImportError: DLL load failed: The specified module could not be found.

What I understand is this is generally an issue of environment activation, or more specifically that environment and path variables are somehow set to resolve the wrong locations for dlls to be discovered before the the paths associated to the virtual environment.

If I activate this environment from the terminal, activate the environment, start python directly, and then import numpy it works fine.

I don't see any messages or errors that are meaningful in the Developer Tools related to this.

@DonJayamanne could you point me to where the environment is activated for the test collection/debugging/running, or even how I might be able to inspect the value of my PATH variable in the context of the Python extension to see how it might differ? I can try to troubleshoot from there...

@dennispg
Copy link

Ok so I dug a little more and tried adding this to the top of conftest.py:

import os
print(os.environ.get("PATH"))

And from this output I was able to verify that the conda environment selected in VSCode is not listed in the PATH variable as it would be if the environment were activated.

So then I changed it to os.environ["PATH"] = "<the correct path info>" and everything works now. My tests get discovered, and I can run and debug each one.

@brettcannon brettcannon removed the info-needed Issue requires more information from poster label May 28, 2019
@DonJayamanne DonJayamanne removed their assignment May 30, 2019
@klyh
Copy link

klyh commented Jun 14, 2019

I have a similar issue, but it feels like the Python debug mechanism does not activate the relevant conda environment before running the compiler.

Here's my workspace settings.json file:
{ "python.terminal.activateEnvironment": true, "python.pythonPath": "C:\\Users\\kl\\AppData\\Local\\Continuum\\miniconda3\\envs\\liquid_snake\\python.exe", "python.venvPath": "C:\\Users\\kl\\AppData\\Local\\Continuum\\miniconda3\\envs" }

As for the debug configuration, I have ensured that the console used is "integratedTerminal".

I was attempting to debug a Flask script. In the first debug run, I encountered the same "ImportError: DLL load failed" error, and I noticed that the conda environment is then activated.

cd "c:\Users\kl\Desktop\proto\spt" && cmd /C "set "FLASK_APP=proto/app.py" && set "FLASK_ENV=development" && set "FLASK_DEBUG=0" && set "PYTHONIOENCODING=UTF-8" && set "PYTHONUNBUFFERED=1" && C:\Users\kl\AppData\Local\Continuum\miniconda3\envs\liquid_snake\python.exe c:\Users\kl.vscode\extensions\ms-python.python-2019.5.18875\pythonFiles\ptvsd_launcher.py --default --client --host localhost --port 50485 -m flask run --no-debugger --no-reload --port=3000 "
Traceback (most recent call last):
File "c:\Users\kl.vscode\extensions\ms-python.python-2019.5.18875\pythonFiles\ptvsd_launcher.py", line 43, in
main(ptvsdArgs)
File "c:\Users\kl.vscode\extensions\ms-python.python-2019.5.18875\pythonFiles\lib\python\ptvsd_main_.py", line 434, in main
run()
File "c:\Users\kl.vscode\extensions\ms-python.python-2019.5.18875\pythonFiles\lib\python\ptvsd_main_.py", line 338, in run_module
run_module_as_main(target, alter_argv=True)
File "C:\Users\kl\AppData\Local\Continuum\miniconda3\envs\liquid_snake\lib\runpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "C:\Users\kl\AppData\Local\Continuum\miniconda3\envs\liquid_snake\lib\runpy.py", line 142, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "C:\Users\kl\AppData\Local\Continuum\miniconda3\envs\liquid_snake\lib\runpy.py", line 109, in get_module_details
import(pkg_name)
File "C:\Users\kl\AppData\Local\Continuum\miniconda3\envs\liquid_snake\lib\site-packages\flask_init
.py", line 21, in
from .app import Flask, Request, Response
File "C:\Users\kl\AppData\Local\Continuum\miniconda3\envs\liquid_snake\lib\site-packages\flask\app.py", line 26, in
from . import cli, json
File "C:\Users\kl\AppData\Local\Continuum\miniconda3\envs\liquid_snake\lib\site-packages\flask\cli.py", line 19, in
import ssl
File "C:\Users\kl\AppData\Local\Continuum\miniconda3\envs\liquid_snake\lib\ssl.py", line 98, in
import _ssl # if we can't import it, let the error propagate
ImportError: DLL load failed: The specified module could not be found.

C:\Users\kl\Desktop\proto\spt>C:/Users/kl/AppData/Local/Continuum/miniconda3/Scripts/activate

(base) C:\Users\kl\Desktop\proto\spt>conda activate liquid_snake

When I ran debug again without closing the debug console, the console retained the conda environment, and is able to run the Flask script:

(liquid_snake) C:\Users\kl\Desktop\proto\spt>cd "c:\Users\kl\Desktop\proto\spt" && cmd /C "set "FLASK_APP=proto/app.py" && set "FLASK_ENV=development" && set "FLASK_DEBUG=0" && set "PYTHONIOENCODING=UTF-8" && set "PYTHONUNBUFFERED=1" && C:\Users\kl\AppData\Local\Continuum\miniconda3\envs\liquid_snake\python.exe c:\Users\kl.vscode\extensions\ms-python.python-2019.5.18875\pythonFiles\ptvsd_launcher.py --default --client --host localhost --port 50497 -m flask run --no-debugger --no-reload --port=3000 "

  • Serving Flask app "proto/app.py"
  • Environment: development
  • Debug mode: off
  • Running on http://127.0.0.1:3000/ (Press CTRL+C to quit)

Is there a way to actually pre-activate the environment before running the debug? I think this may solve the issue at hand.

@larsoleruben
Copy link

larsoleruben commented Jun 27, 2019

HI I found that if I open a cmd window, and activate the conda enviromment from there, and then start code from within the window, opening the right folder, it actually works!

@klyh
Copy link

klyh commented Jul 1, 2019

HI I found that if I open a cmd window, and activate the conda enviromment from there, and then start code from within the window, opening the right folder, it actually works!

Well, that's the definite way of activating environment prior to debugging the solution. However, I would like to 'load' the Python environment before debugging.

I have even tried to create a separate task trying to load the conda environment before debugging, but I could not combine both integrated terminals together.

@ysystudio
Copy link

Seem to fix the issue by adding "python": "${command:python.interpreterPath}" to the standard launch.json file
See below :
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"python": "${command:python.interpreterPath}"
}
]
}

@niveshd
Copy link

niveshd commented Mar 17, 2021

Hi everybody,

I came across this post having more or less all the problems mentioned above. Running code, debugging code and running tests with pytest worked fine - however, debugging a test case failed as the environment wasn't properly loaded. I read through here: https://code.visualstudio.com/docs/python/testing

What helped was adding another configuration to my lauch.json with request set to test.

See below the launch.json I am using.

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debugging",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "python.pythonPath": "c:/Users/EricVogel/Anaconda3/envs/a38/python.exe"
        },
        {
            "name": "Debug Tests",
            "type": "python",
            "request": "test",
            "program": "${file}",
            "console": "integratedTerminal",
            "python.pythonPath": "c:/Users/EricVogel/Anaconda3/envs/a38/python.exe"
        }
    ]
}

I prefer this solution (with some modifications) to others. I just had to modify launch.json and use integrated terminal while debugging (the solution proposed above). I removed the python path line in the json file since selecting conda env (select interpreter) worked for me. Also I had to remove the "program" keyword for debugging pytests. With this, I had no import errors while debugging a single file or a pytest function/class.

Activate environment and starting vscode from powershell worked for me but it is a hassle compared to editing launch.json and living with the integrated environment.

Modified launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debug file",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
        },
        {
            "name": "Debug tests",
            "type": "python",
            "request": "test",
            "console": "integratedTerminal",
        }
    ]
}

@karrtikr
Copy link

Hi everyone 👋 please try this workaround for conda until we get this fixed which requires coordination with VSCode and conda.

  1. Anaconda prompt and cd to your workspace.
  2. Activate the environment using conda activate
  3. Start VS Code using code .

related #10626. This works in most cases except remote.

If that doesn't work, as a temporary solution please change the setting terminal.integrated.inheritEnv to false as outlined in https://code.visualstudio.com/updates/v1_36#_launch-terminals-with-clean-environments.

@danieltuzes
Copy link

What is wrong with the workaround mentioned by @niveshd ? The one you suggest needs to be doe every time we start VS Code, and if another env is wanted to be used for debugging, we need to restart VS Code, don't we?

The page you suggest tells that this has no effect in Windows. Is your suggestion OS-specific?

@alyssalarios
Copy link

I was having the same problem and none of the suggested solutions above seemed to be working (Windows 10, python 3.8, VScode 1.56). I found that my issue was from the Powershell not properly activating my conda environment when I ran the script within or outside of the debugger. When I ran the script from the command prompt or imported numpy in the terminal everything worked as it should.

Inside the user settings.json (not the settings.json for configuring the current interpreter found in .vscode folder) found in
'C:\Users\me\AppData\Roaming\Code\User\settings.json'
I added the setting
` terminal.integrated.automationShell.windows": "C:\Windows\System32\cmd.exe'

I believe this tells VScode to run all debugging sessions with the command prompt instead of the default powershell. Hope this helps someone else who's having the same issue.

@foster999
Copy link

"request":"test" seems to be invalid now, so I had to use this configuration to switch to using the integrated terminal:

        {
            "name": "Python: Pytest",
            "type": "python",
            "request": "launch",
            "purpose": ["debug-test"],
            "console": "integratedTerminal",
        },

@dmarx
Copy link

dmarx commented Feb 15, 2022

workaround I'm currently using that I haven't seen discussed: instead of invoking pytest on the terminal, invoke python -m pytest to ensure that we're using the python binary of the activated environment.

@kopytjuk
Copy link

A friend of my spend several hours on his Windows machine until I pointed out to this thread here, maybe this issue shall be investigated by microsoft devs with a higher priority. At least to avoid people saying Windows is developer unfriendly ... Especially, the conda/vscode combination works on mac/linux.

@AshleyT3
Copy link

My setup followed below by workaround...

  • VS Code Version: 1.66.2 (system setup)
  • OS Version: 21H2 19044.1706
  • Python 3.10 and 3.9.12 are installed.
  • Using 3.9.12 venv for primary work effort.
  • No Conda, not using Conda.

TL;DR: I launch VS Code from desktop shell which picks up global Python env by default, where VS Code will use configured venv just fine for app debugging, but not for pytest test debugging. To workaround, I launch VS Code from command prompt that has desired venv active and VS Code then uses that venv during debugging for both the app debugging (which never had an issue) and pytest test debugging (which had an issue, resolved with this workaround). No issues outside of debugging.

Details...

When debugging primary app with 3.9.12 venv, no issues whatsoever. If I launch with breakpoint at start of main app (not pytest test), and run the below in VS Code debugging console, I see it has selected the right python.exe from the venv. And this is my VS Code venv setting.

import shutil
shutil.which("python.exe")
'C:\\venvs\\venv2-3.9.12\\Scripts\\python.exe'

With the same above configuration, when I choose to debug a test under pytest, the debugger works, but when I set a breakpoint at start of test, run the same commands as above, here is what I see...

import shutil
shutil.which("python.exe")
'C:\\Users\\PythonUser\\AppData\\Local\\Programs\\Python\\Python310\\python.exe'

It is using the global (non-venv) Python 3.10 installation despite VS Code being set/configured for the 3.9.12 venv which works great when debugging a non-pytest app.

The workaround I'm using is to activate the venv from PowerShell and launch code.cmd from the same PowerShell terminal window as follows...

PS C:\venvs\venv2-3.9.12\Scripts> .\Activate.ps1
(venv2-3.9.12) PS C:\venvs\venv2-3.9.12\Scripts> code.cmd
(venv2-3.9.12) PS C:\venvs\venv2-3.9.12\Scripts>

After doing the above, when I hit that same breakpoint in the pytest test mentioned above, and run the same commands to find python.exe, it seems it can find it just fine...

import shutil
shutil.which("python.exe")
'C:\\venvs\\venv2-3.9.12\\Scripts\\python.exe'

I also checked os.getenv('PATH') and it reveals a proper path setup for that 3.9.12 venv, unlike when I check the path when debugging the pytest test while relying on VS Code alone to select the right venv.

The main difference is I launched VS Code two different ways, one from the command prompt with venv setup, the other from desktop shell (Start/Menu/Code) which picks up global Python env by default and despite VS Code using the selected venv for development purposes, it fails to use the venv when debugging pytest. Debugging works great, but it's under a Python 3.10 environment which is undesired.

As others reported, running a pytest worked fine... it seemed tied to debugging for some reason.

@tekumara
Copy link

tekumara commented Jun 5, 2022

I prefer the internal console to the integration terminal, and in order for scripts in my virtualenv to be found, I explicitly add the virtualenv's bin/ to the path:

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "testing",
      "type": "python",
      "request": "launch",
      "purpose": ["debug-test"],
      "justMyCode": false
      "env": { "PATH": "${workspaceFolder}/.venv/bin"}
    }
  ]
}

This prepends my virtualenv in ${workspaceFolder}/.venv/bin to the path, and preserves existing path entries.

@karrtikr karrtikr added the area-environments Features relating to handling interpreter environments label Jun 7, 2022
@karrtikr
Copy link

Workaround for remote scenarios

In scenarios where it's not possible to launch VSCode via an activated environment, I have captured the instructions in a GIF:

debugger

Here're step by step instructions for the example:

  • Consider the conda environment is "hello".
  • Create a new terminal profile for the particular conda environment you intend to work with.
  • Use Open User Settings (JSON) to open user settings, and append the profile created with:
"args": ["-c", "source <path_to_conda_install>/bin/activate hello;$SHELL"]
  • You can use the $PATH environment variable to figure out the path to conda install. For eg. it could be ~/miniconda3 or /opt/conda in my case.
  • Select the default profile for the terminal to be the one you configured.
  • Verify that for any new terminals you create, conda environment hello is already activated.

@itcarroll
Copy link

Haven't had success with proposed workarounds when using the Remote-SSH extension. I wouldn't mind starting in an activated environment, but @karrtikr 's instructions do not appear to effect the shell used by the test-debugger.

@dhapolapankaj
Copy link

Adding below key:value pair in launch.json file, fixed my problem

"env": {"PATH":"${workspaceFolder}/venv/Scripts/"},

Then run below code in any PowerShell terminal to set the execution policy to run PowerShell code

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

It runs Activate.ps1 (which activates python environment) file in PowerShell debug terminal, before running the python file that has break point.

@karrtikr
Copy link

Should be fixed in the latest stable release of Python extension, please give it a try.

@karrtikr karrtikr added this to the September 2023 milestone Sep 11, 2023
@github-actions github-actions bot removed the needs PR Ready to be worked on label Sep 11, 2023
@karrtikr karrtikr added the verified Verification succeeded label Sep 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-debugging area-environments Features relating to handling interpreter environments area-testing bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Projects
None yet
Development

No branches or pull requests