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

Debug stop working with modules on version 2018.10.x #3309

Open
sharkguto opened this Issue Nov 12, 2018 · 9 comments

Comments

Projects
None yet
5 participants
@sharkguto
Copy link

sharkguto commented Nov 12, 2018

Environment data

  • VS Code version:
code --version
1.28.2
7f3ce96ff4729c91352ae6def877e59c561f4850
x64

or

code-insiders --version
1.29.0-insider
5f24c93878bd4bc645a4a17c620e2487b11005f9
x64
  • Extension version (available under the Extensions sidebar): - OS and version: ubuntu 18.04
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.6.6
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
  • Relevant/affected Python packages and their versions:

Actual behavior

debugger not working with modules

image

Expected behavior

debugger should work with modules back again.... like in version 2018.09. ~~ I am not able to rollback python ext, in current vscode stable and insiders version.~~

Steps to reproduce:

  1.          "name": "Python: Module",
             "type": "python",
             "request": "launch",
             "module": "qconsumer",
             "console": "integratedTerminal"
         },```
    

or

{
            "name": "Python: Current File (Integrated Terminal)",
            "type": "python",
            "request": "launch",
            "program": "${workspaceFolder}/qconsumer/__main__.py",
            "console": "integratedTerminal",
        },```

2. press f5

## Logs
Output for `Python` in the `Output` panel (`View`→`Output`, change the drop-down the upper-right of the `Output` panel to `Python`)

output

Starting Microsoft Python language server.
Microsoft Python Language Server version 0.1.60.0
Initializing for /usr/bin/python3
##########Linting Output - pylint##########


Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)

##########Linting Output - pylint##########


Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)

##########Linting Output - pylint##########


Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)


terminal

cd /home/gustavo/github/consumerq-svc ; env "PYTHONIOENCODING=UTF-8" "PYTHONUNBUFFERED=1" /usr/bin/python3 /home/gustavo/.vscode/extensions/ms-python.python-2018.10.1/pythonFiles/experimental/ptvsd_launcher.py --client --host localhost --port 41131 /home/gustavo/github/consumerq-svc/qconsumer/main.py
Traceback (most recent call last):
File "/home/gustavo/.vscode/extensions/ms-python.python-2018.10.1/pythonFiles/experimental/ptvsd_launcher.py", line 38, in
main(sys.argv)
File "/home/gustavo/.vscode/extensions/ms-python.python-2018.10.1/pythonFiles/experimental/ptvsd/ptvsd/main.py", line 265, in main
wait=args.wait)
File "/home/gustavo/.vscode/extensions/ms-python.python-2018.10.1/pythonFiles/experimental/ptvsd/ptvsd/main.py", line 258, in handle_args
debug_main(addr, name, kind, *extra, **kwargs)
File "/home/gustavo/.vscode/extensions/ms-python.python-2018.10.1/pythonFiles/experimental/ptvsd/ptvsd/_local.py", line 45, in debug_main
run_file(address, name, *extra, **kwargs)
File "/home/gustavo/.vscode/extensions/ms-python.python-2018.10.1/pythonFiles/experimental/ptvsd/ptvsd/_local.py", line 79, in run_file
run(argv, addr, **kwargs)
File "/home/gustavo/.vscode/extensions/ms-python.python-2018.10.1/pythonFiles/experimental/ptvsd/ptvsd/_local.py", line 140, in _run
_pydevd.main()
File "/home/gustavo/.vscode/extensions/ms-python.python-2018.10.1/pythonFiles/experimental/ptvsd/ptvsd/_vendored/pydevd/pydevd.py", line 1925, in main
debugger.connect(host, port)
File "/home/gustavo/.vscode/extensions/ms-python.python-2018.10.1/pythonFiles/experimental/ptvsd/ptvsd/_vendored/pydevd/pydevd.py", line 1283, in run
return self._exec(is_module, entry_point_fn, module_name, file, globals, locals)
File "/home/gustavo/.vscode/extensions/ms-python.python-2018.10.1/pythonFiles/experimental/ptvsd/ptvsd/_vendored/pydevd/pydevd.py", line 1290, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "/home/gustavo/.vscode/extensions/ms-python.python-2018.10.1/pythonFiles/experimental/ptvsd/ptvsd/_vendored/pydevd/_pydev_imps/_pydev_execfile.py", line 25, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/home/gustavo/github/consumerq-svc/qconsumer/main.py", line 13, in
from qconsumer.runnables import runnable
ModuleNotFoundError: No module named 'qconsumer'


insiders

Traceback (most recent call last):
File "/home/gustavo/.vscode-insiders/extensions/ms-python.python-2018.10.1/pythonFiles/experimental/ptvsd_launcher.py", line 38, in
main(sys.argv)
File "/home/gustavo/.vscode-insiders/extensions/ms-python.python-2018.10.1/pythonFiles/experimental/ptvsd/ptvsd/main.py", line 265, in main
wait=args.wait)
File "/home/gustavo/.vscode-insiders/extensions/ms-python.python-2018.10.1/pythonFiles/experimental/ptvsd/ptvsd/main.py", line 258, in handle_args
debug_main(addr, name, kind, *extra, **kwargs)
File "/home/gustavo/.vscode-insiders/extensions/ms-python.python-2018.10.1/pythonFiles/experimental/ptvsd/ptvsd/_local.py", line 45, in debug_main
run_file(address, name, *extra, **kwargs)
File "/home/gustavo/.vscode-insiders/extensions/ms-python.python-2018.10.1/pythonFiles/experimental/ptvsd/ptvsd/_local.py", line 79, in run_file
run(argv, addr, **kwargs)
File "/home/gustavo/.vscode-insiders/extensions/ms-python.python-2018.10.1/pythonFiles/experimental/ptvsd/ptvsd/_local.py", line 140, in _run
_pydevd.main()
File "/home/gustavo/.vscode-insiders/extensions/ms-python.python-2018.10.1/pythonFiles/experimental/ptvsd/ptvsd/_vendored/pydevd/pydevd.py", line 1925, in main
debugger.connect(host, port)
File "/home/gustavo/.vscode-insiders/extensions/ms-python.python-2018.10.1/pythonFiles/experimental/ptvsd/ptvsd/_vendored/pydevd/pydevd.py", line 1283, in run
return self._exec(is_module, entry_point_fn, module_name, file, globals, locals)
File "/home/gustavo/.vscode-insiders/extensions/ms-python.python-2018.10.1/pythonFiles/experimental/ptvsd/ptvsd/_vendored/pydevd/pydevd.py", line 1290, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "/home/gustavo/.vscode-insiders/extensions/ms-python.python-2018.10.1/pythonFiles/experimental/ptvsd/ptvsd/_vendored/pydevd/_pydev_imps/_pydev_execfile.py", line 25, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/home/gustavo/github/consumerq-svc/qconsumer/main.py", line 13, in
from qconsumer.runnables import runnable
ModuleNotFoundError: No module named 'qconsumer'


Output from `Console` under the `Developer Tools` panel (toggle Developer Tools on under `Help`)

workbench.main.js:sourcemap:225 [Violation] Added non-passive event listener to a scroll-blocking 'mousewheel' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952

@sharkguto

This comment has been minimized.

Copy link
Author

sharkguto commented Nov 12, 2018

image

i installed manually the version 2018.9.1 and it working again \o/
https://github.com/Microsoft/vscode-python/releases/download/2018.9.1/ms-python-release-2018.9.vsix

@DonJayamanne

This comment has been minimized.

Copy link

DonJayamanne commented Nov 12, 2018

This issue was moved to Microsoft/ptvsd#1008

@DonJayamanne

This comment has been minimized.

Copy link

DonJayamanne commented Nov 12, 2018

@sharkguto
As a temporary solution you can update your launch.json as follows:

"env":{
	"PYTHONPATH":"${workspaceFolder}"
}
@DonJayamanne

This comment has been minimized.

Copy link

DonJayamanne commented Nov 12, 2018

@sharkguto
I'm unable to replicate this at my end.
Would you be able to share this repo with me? or could you share some other sample code that works in 2018.9.1 and NOT in 2018.10.x.

@DonJayamanne DonJayamanne removed the P0 label Nov 12, 2018

@DonJayamanne

This comment has been minimized.

Copy link

DonJayamanne commented Nov 12, 2018

Downgrading priority as it never did work in previous versions.

@JeremyKennedy

This comment has been minimized.

Copy link

JeremyKennedy commented Nov 13, 2018

I can confirm this issue has been introduced in a recent release. I used to be able to run using a "module" launch configuration, but trying that today gave me a ModuleNotFoundError. Same for all the other devs on my team. Making the change mentioned by @DonJayamanne fixed the issue for us.

@DonJayamanne

This comment has been minimized.

Copy link

DonJayamanne commented Nov 14, 2018

As a temporary solution, please add the following into your launch.json

	"env": {
		"PYTHONPATH": "${workspaceFolder}"
	}
@AlexandreOuellet

This comment has been minimized.

Copy link

AlexandreOuellet commented Nov 14, 2018

@DonJayamanne

Would you be able to share this repo with me? or could you share some other sample code that works in 2018.9.1 and NOT in 2018.10.x

Here is a repo that shows the issue with 2018.10.1 that is not present with 2018.9.0 : https://github.com/AlexandreOuellet/vscode-import-bug

@sharkguto

This comment has been minimized.

Copy link
Author

sharkguto commented Nov 16, 2018

@DonJayamanne sorry about the delay to answer you, but your temporary fix worked for me :)

{
            "name": "Python: Module",
            "type": "python",
            "request": "launch",
            "module": "authenticator_server",
            "console": "integratedTerminal",
            "env": {
                "PYTHONPATH": "${workspaceFolder}"
            }
        },

Thanks buddy, you rock 🥇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.