Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4567

Python • python debugging on vscode

$
0
0
I've been using vscode for python development on my several raspberry pi machines for quite some time. Recently one machine started misbehaving. In vscode, the python program will run fine however, trying to debug the same code results in a stream of errors that appear unrelated to my code, then several seconds later a dialog box "Timed out waiting for debugee to spawn". I don't think I've changed anything recently in this setup. Same results whether running vscode locally on the pi in question or remotely from another machine. So far I've tried uninstalling vscode and removing any related directories/files I could find then re-installing. Also tried sudo apt install --reinstall python3 python3-pip and sudo apt --fix-broken install to no effect. I've rolled back vscode extensions for Python, pylance & python debugger to earlier versions in case a recent update snuck in when I wasn't looking. The machine is a Pi4 model B 8GB with a vanilla install of Raspberry Pi OS - with desktop. This problem occurs even with a single line of code: "print('hello world')". Error message below. TIA for any suggestions!

cd /home/pi ; /usr/bin/env /bin/python /home/pi/.vscode/extensions/ms-python.debugpy-2024.6.0-linux-armhf/bundled/libs/debugpy/adapter/../../debugpy/launcher 54767 -- /home/pi/PythonModules/test.py
Traceback (most recent call last):
File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/pi/.vscode/extensions/ms-python.debugpy-2024.6.0-linux-armhf/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/__main__.py", line 37, in <module>
from debugpy.server import cli
File "/home/pi/.vscode/extensions/ms-python.debugpy-2024.6.0-linux-armhf/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/__init__.py", line 7, in <module>
import debugpy._vendored.force_pydevd # noqa
File "/home/pi/.vscode/extensions/ms-python.debugpy-2024.6.0-linux-armhf/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/_vendored/force_pydevd.py", line 34, in <module>
pydevd_constants = import_module('_pydevd_bundle.pydevd_constants')
File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/home/pi/.vscode/extensions/ms-python.debugpy-2024.6.0-linux-armhf/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_constants.py", line 394, in <module>
from _pydev_bundle._pydev_saved_modules import thread, threading
File "/home/pi/.vscode/extensions/ms-python.debugpy-2024.6.0-linux-armhf/bundled/libs/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_saved_modules.py", line 100, in <module>
import xmlrpc.client as xmlrpclib; verify_shadowed.check(xmlrpclib, ['ServerProxy', 'Marshaller', 'Server'])
File "/usr/lib/python3.9/xmlrpc/client.py", line 136, in <module>
import http.client
File "/usr/lib/python3.9/http/client.py", line 71, in <module>
import email.parser
File "/usr/lib/python3.9/email/parser.py", line 12, in <module>
from email.feedparser import FeedParser, BytesFeedParser
File "/usr/lib/python3.9/email/feedparser.py", line 27, in <module>
from email._policybase import compat32
File "/usr/lib/python3.9/email/_policybase.py", line 9, in <module>
from email.utils import _has_surrogates
File "/usr/lib/python3.9/email/utils.py", line 33, in <module>
from email._parseaddr import quote
File "/usr/lib/python3.9/email/_parseaddr.py", line 16, in <module>
import time, calendar
File "/usr/lib/python3.9/calendar.py", line 50, in <module>
class _localized_month:
File "/usr/lib/python3.9/calendar.py", line 52, in _localized_month
_months = [datetime.date(2001, i+1, 1).strftime for i in range(12)]
File "/usr/lib/python3.9/calendar.py", line 52, in <listcomp>
_months = [datetime.date(2001, i+1, 1).strftime for i in range(12)]
AttributeError: 'date' object has no attribute 'strftime'

Statistics: Posted by kluger — Sun Sep 29, 2024 6:53 pm — Replies 1 — Views 33



Viewing all articles
Browse latest Browse all 4567

Trending Articles