Vscode-docker: "Python ν™•μž₯μ—μ„œ 디버거λ₯Ό 찾을 수 μ—†μŒ"κ³Ό ν•¨κ»˜ Python 디버그가 μ‹€νŒ¨ν•¨

에 λ§Œλ“  2020λ…„ 06μ›” 18일  Β·  13μ½”λ©˜νŠΈ  Β·  좜처: microsoft/vscode-docker

image

Python Debug external tracking

κ°€μž₯ μœ μš©ν•œ λŒ“κΈ€

Docker ν™•μž₯ v 1.3.1이 있고 μ—¬μ „νžˆ 이것을 보고 μžˆμŠ΅λ‹ˆλ‹€.

버전: 1.46.1
컀밋: cd9ea6488829f560dc949a8b2fb789f3cdc05f5d
λ‚ μ§œ: 2020-06-17T21:17:14.222Z (2일 μ „)
μ „μž: 7.3.1
크둬: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-μ „μž.0
운영 체제: λ‹€μœˆ x64 19.3.0

    > Executing task: docker-run: debug <
    Unable to find the debugger in the Python extension.
    The terminal process failed to launch (exit code: 1)
    Terminal will be reused by tasks, press any key to close it.

런치.json

{
    "version": "0.2.0",
    "logToFile": true,
    "configurations": [
        {

            "name": "Docker: Python - General",
            "type": "docker",
            "request": "launch",
            "preLaunchTask": "docker-run: debug",
            "python": {
                "pathMappings": [
                    {
                        "localRoot": "${workspaceFolder}",
                        "remoteRoot": "/code"
                    }
                ],
                "projectType": "general"
            }
        }
    ]
}

λͺ¨λ“  13 λŒ“κΈ€

이에 λŒ€ν•œ μˆ˜μ • 사항이 이제 Docker ν™•μž₯ 버전 1.3.1μ—μ„œ λ¦΄λ¦¬μŠ€λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

Docker ν™•μž₯ v 1.3.1이 있고 μ—¬μ „νžˆ 이것을 보고 μžˆμŠ΅λ‹ˆλ‹€.

버전: 1.46.1
컀밋: cd9ea6488829f560dc949a8b2fb789f3cdc05f5d
λ‚ μ§œ: 2020-06-17T21:17:14.222Z (2일 μ „)
μ „μž: 7.3.1
크둬: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-μ „μž.0
운영 체제: λ‹€μœˆ x64 19.3.0

    > Executing task: docker-run: debug <
    Unable to find the debugger in the Python extension.
    The terminal process failed to launch (exit code: 1)
    Terminal will be reused by tasks, press any key to close it.

런치.json

{
    "version": "0.2.0",
    "logToFile": true,
    "configurations": [
        {

            "name": "Docker: Python - General",
            "type": "docker",
            "request": "launch",
            "preLaunchTask": "docker-run: debug",
            "python": {
                "pathMappings": [
                    {
                        "localRoot": "${workspaceFolder}",
                        "remoteRoot": "/code"
                    }
                ],
                "projectType": "general"
            }
        }
    ]
}

λ‚˜λŠ” vscode에 μ΅μˆ™ν•˜μ§€ μ•Šμ§€λ§Œ 여기에 λ‚΄κ°€ λ‘œμ»¬μ—μ„œ λ³΄λŠ” 것에 λŒ€ν•œ μ’€ 더 μžμ„Έν•œ λ‚΄μš©μ΄ μžˆμŠ΅λ‹ˆλ‹€.

버그 μˆ˜μ • μ»€λ°‹μ—μ„œ launcher.py의 μ½”λ“œκ°€ 적용된 것 κ°™μŠ΅λ‹ˆλ‹€.

.vscodeμ—μ„œ "디버거λ₯Ό 찾을 수 μ—†μŒ"에 λŒ€ν•΄ grepν•˜λ©΄ λ‹€μŒκ³Ό 같이 ν‘œμ‹œλ©λ‹ˆλ‹€.

/.vscode//extensions/ms-azuretools.vscode-docker-1.3.1/dist/extension.bundle.js

<snip>
||void 0===e?void 0:e.debug)||void 0===n?void 0:n.getDebuggerPackagePath());if(s)return s;throw new Error(a.localize("vscode-docker.tasks.pythonExt.noDebugger",
"Unable to find the debugger in the Python extension."))} ,e.getPythonExtension=getPythonExtension}(n.PythonExtensionHelper||(n.PythonExtensionHelper={}))},function(e,n,i){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.nodeDebugHelper=n.NodeDebugHelper=void 0;const s=i(367),o=i(368),a=i(193);class NodeDebugHelper{async provideDebugConfigurations(e){return[{name:"Docker Node.js Launch",type:"docker",request:"launch",preLaunchTask:"docker-run: debug",platform:"node"}]}async resolveDebugConfiguration(e,n){const i=n.node||{},l=s.NodeTaskHelper.inferPackagePath(i.package,e.folder),u=await o.readPackage(l),c=await o.inferPackageName(u,l),p=a.inferContainerName(n,e,c),d={containerName:p,dockerServerReadyAction:a.resolveDockerServerReadyAction(n,{containerName:p},!0),removeContainerAfterDebug:n.removeContainerAfterDebug},m={...i,name:n.name,dockerOptions:d,preLaunchTask:n.preLaunchTask,request:"attach",type:"node2"};return void 0===m.localRoot&&(m.localRoot="${workspaceFolder}"),void 0===m.port&&
<snip>

컀밋은 .ts νŒŒμΌμ—μ„œ μ œκ±°ν•œ κ²ƒμœΌλ‘œ λ³΄μž…λ‹ˆλ‹€. μ•„λ§ˆλ„ js λ²ˆλ“€μ˜ μƒˆ λΉŒλ“œκ°€ μ—…λ°μ΄νŠΈμ—μ„œ κ°•μ œ μ μš©λ˜μ§€ μ•ŠμŠ΅λ‹ˆκΉŒ?

@kbroughton @EduardBlinov @Mikecom32 μ–΄λ–€ λ²„μ „μ˜ Python ν™•μž₯이 μžˆμŠ΅λ‹ˆκΉŒ?

νŽΈμ§‘: @Mikecom32 κ°€ 2020.6.88468κ³Ό 2020.6.89148을 λͺ¨λ‘ μ‹œλ„ν•œ κ²ƒμœΌλ‘œ λ‚˜νƒ€λ‚¬μŠ΅λ‹ˆλ‹€. λ‘˜ λ‹€ μž‘λ™ν•΄μ•Ό ν•©λ‹ˆλ‹€.

@luabud μ‚¬μš©μžκ°€ μƒˆλ‘œμš΄ debugpy 디버거λ₯Ό μ˜΅νŠΈμ•„μ›ƒν•  수 μžˆλŠ” 방법이 μžˆμŠ΅λ‹ˆκΉŒ? 두 λ²„μ „μ˜ Python ν™•μž₯ λͺ¨λ‘μ—μ„œ Python ν™•μž₯μ—μ„œ undefined λ₯Ό 가져와야 ν•˜λŠ” μœ μΌν•œ 방법은 DebugAdapterNewPtvsd.experiment μ˜΅νŠΈμΈλ˜μ§€ μ•Šμ€ κ²ƒμœΌλ‘œ κ²°μ •λ˜λŠ” κ²½μš°μž…λ‹ˆλ‹€.

λ¬Έμ œλŠ” Python ν™•μž₯에 μžˆμ—ˆμœΌλ©° https://github.com/microsoft/vscode-python/issues/12481의 κ·Όλ³Έ 원인과 λ™μΌν•©λ‹ˆλ‹€

https://github.com/microsoft/vscode-python/issues/12484 μ—μ„œ @ddurham2 κ°€ 치고 μžˆλŠ” 것일 μˆ˜λ„ μžˆμŠ΅λ‹ˆλ‹€.

ν™•μž₯ ν”„λ‘œκ·Έλž¨μ€ v2020.6.89148 @bwateratmsft 라고 λ§ν•©λ‹ˆλ‹€.

@kbroughton κ°μ‚¬ν•©λ‹ˆλ‹€. μ—…κ·Έλ ˆμ΄λ“œν•  ν•„μš” 없이 Python ν™•μž₯ μΈ‘λ©΄μ—μ„œ μ§€κΈˆ μˆ˜μ •ν•΄μ•Ό ν•œλ‹€κ³  μƒκ°ν•©λ‹ˆλ‹€. μ‹œλ„ν•΄ λ³΄μ•˜μ§€λ§Œ 더 이상 문제λ₯Ό μž¬ν˜„ν•  수 μ—†μŠ΅λ‹ˆλ‹€. μ‹œλ„ν•΄ λ³Ό 수 μžˆμŠ΅λ‹ˆκΉŒ? μ‹€ν—˜ ν”„λ ˆμž„μ›Œν¬κ°€ Python ν™•μž₯μ—μ„œ μ–΄λ–»κ²Œ κ΅¬ν˜„λ˜μ—ˆλŠ”μ§€λŠ” ν™•μ‹€ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€. @luabud 이 이에 λŒ€ν•΄ λ‹΅λ³€ν•  수 μžˆμŠ΅λ‹ˆλ‹€. κ·ΈλŸ¬λ‚˜ μƒˆ μ‹€ν—˜ 데이터가 λ‹€μ‹œ μž‘λ™ν•˜κΈ° μ‹œμž‘ν•˜κΈ° 전에 λ‹€μš΄λ‘œλ“œν•˜λŠ” 데 μ•½κ°„μ˜ μ‹œκ°„μ΄ 걸릴 수 μžˆμŠ΅λ‹ˆλ‹€.

nether docker λ˜λŠ” python ν™•μž₯은 VS μ½”λ“œμ— μ‚¬μš©ν•  수 μžˆλŠ” μ—…λ°μ΄νŠΈλ₯Ό λ³΄μ—¬μ€λ‹ˆλ‹€. μ–΄λ–»κ²Œ μ‹œλ„ν•©λ‹ˆκΉŒ? @bwateratmsft

@kbroughton Python ν™•μž₯의 μˆ˜μ • 사항은 이미 μ„œλ²„μ—μ„œ μ‹€ν—˜μ— λŒ€ν•œ 정보λ₯Ό κ°€μ Έμ˜€κ³  있기 λ•Œλ¬Έμ— μ—…λ°μ΄νŠΈκ°€ ν•„μš”ν•˜μ§€ μ•Šμ•„μ•Ό ν•©λ‹ˆλ‹€. VS Codeλ₯Ό λ‹€μ‹œ μ‹œμž‘ν•΄λ„ 도움이 λ˜μ§€ μ•ŠμŠ΅λ‹ˆκΉŒ?

μ—¬κΈ° μ—μ„œ Pavel이 μ–ΈκΈ‰ν•œ 섀정을 μΆ”κ°€ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

    "python.experiments.optInto": [
        "DebugAdapterFactory - experiment",
        "PtvsdWheels37 - experiment"
    ],

VSCodeλ₯Ό λ‹€μ‹œ μ‹œμž‘ν–ˆμ§€λ§Œ λ™μΌν•œ 였λ₯˜κ°€ λ°œμƒν•©λ‹ˆλ‹€.
μ—¬κΈ° λ‚΄ launch.json이 μžˆμŠ΅λ‹ˆλ‹€.

{
// IntelliSenseλ₯Ό μ‚¬μš©ν•˜μ—¬ κ°€λŠ₯ν•œ νŠΉμ„±μ— λŒ€ν•΄ μ•Œμ•„λ΄…λ‹ˆλ‹€.
// κΈ°μ‘΄ 속성에 λŒ€ν•œ μ„€λͺ…을 보렀면 마우슀λ₯Ό κ°€μ Έκ°‘λ‹ˆλ‹€.
// μžμ„Έν•œ λ‚΄μš©μ€ λ‹€μŒμ„ μ°Έμ‘°ν•˜μ„Έμš”.
https://go.microsoft.com/fwlink/?linkid=830387
"버전": "0.2.0",
"logToFile": μ°Έ,
"ꡬ성": [

{
"이름": "도컀: Python - 일반",
"μœ ν˜•": "도컀",
"μš”μ²­": "μ‹€ν–‰",
"preLaunchTask": "도컀 μ‹€ν–‰: 디버그",
"파이썬": {
"경둜 맀핑": [
{
"localRoot": "${workspaceFolder}",
"원격 루트": "/μ½”λ“œ"
}
],
"projectType": "일반"
}
}
],
"python.experiments.optInto": [
"DebugAdapterFactory - μ‹€ν—˜",
"PtvsdWheels37 - μ‹€ν—˜"
]
}

2020λ…„ 6μ›” 22일 μ›”μš”μΌ μ˜€ν›„ 4μ‹œ 55뢄에 Hani Amr [email protected]이 μž‘μ„±ν–ˆμŠ΅λ‹ˆλ‹€.

@kbroughton https://github.com/kbroughton Pythonμ—μ„œ μˆ˜μ •
ν™•μž₯ ν”„λ‘œκ·Έλž¨μ€ 이미 풀링 μ€‘μ΄λ―€λ‘œ μ—…λ°μ΄νŠΈκ°€ ν•„μš”ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.
μ„œλ²„μ˜ μ‹€ν—˜μ— λŒ€ν•œ 정보, VS Code λ‹€μ‹œ μ‹œμž‘
λ„μ›€μ΄λ˜μ§€ μ•Šμ•˜λ‹€?

μ—¬κΈ°μ—μ„œ Pavel이 μ–ΈκΈ‰ν•œ 섀정을 μΆ”κ°€ν•  수 μžˆμŠ΅λ‹ˆλ‹€.
https://github.com/microsoft/vscode-python/issues/12481#issuecomment-647266379
:

"python.experiments.optInto": [
    "DebugAdapterFactory - experiment",
    "PtvsdWheels37 - experiment"
],

β€”
당신이 μ–ΈκΈ‰λ˜μ—ˆκΈ° λ•Œλ¬Έμ— 이것을 λ°›λŠ” κ²ƒμž…λ‹ˆλ‹€.
이 이메일에 직접 λ‹΅μž₯ν•˜κ³  GitHubμ—μ„œ ν™•μΈν•˜μ„Έμš”.
https://github.com/microsoft/vscode-docker/issues/2080#issuecomment-647788957 ,
λ˜λŠ” ꡬ독 μ·¨μ†Œ
https://github.com/notifications/unsubscribe-auth/ACQSXMQ7OKS75IR7L64A7LLRX7HOFANCNFSM4OBVI4ZA
.

ν•΄λ‹Ή python.experiments.optInto μ„Ήμ…˜μ€ launch.json이 μ•„λ‹Œ settings.json으둜 이동해야 ν•©λ‹ˆλ‹€.

Python ν™•μž₯ μΈ‘λ©΄μ—μ„œ μˆ˜μ •λœ κ²ƒμœΌλ‘œ λ³΄μ΄λ―€λ‘œ 이 문제λ₯Ό λ‹€μ‹œ λ‹«κ² μŠ΅λ‹ˆλ‹€.

이 νŽ˜μ΄μ§€κ°€ 도움이 λ˜μ—ˆλ‚˜μš”?
0 / 5 - 0 λ“±κΈ‰