5

Whenever I try to debug any python code in VScode (or even visual studio), I run into errors before it reaches the first line of code (or so it would seem). I was able to debug in both VScode and Visual Studio ~18hrs ago on both my laptop and my desktop computers before taking a break. As of ~4hrs ago, I kept running into the errors when trying to run the debug. I am able to run code through python.exe without a problem through the cmd.exe C:\Python\Python37-32\python.exe C:\Coding\Codecademy\Python\one.py.

I have tried uninstalling VScode, Visual Studio, and python, as well as deleted all files pertaining to any VScode or Visual studio. I then reinstalled VScode and python 3.7, though the errors still occur in the terminal. This occurs even with a simple print("Hello World").

I am currently using the Python extension from Microsoft with no other extensions installed.

The error code is as follows:

Traceback (most recent call last):
  File "c:\Users\kyrus\.vscode\extensions\ms-python.python-2018.9.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_process_net_command.py", line 841, in process_net_command
    py_db.writer.add_command(cmd)
  File "c:\Users\kyrus\.vscode\extensions\ms-python.python-2018.9.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_comm.py", line 448, in add_command
    self.cmdQueue.put(cmd)
AttributeError: 'Queue' object has no attribute 'put'
Traceback (most recent call last):
  File "c:\Users\kyrus\.vscode\extensions\ms-python.python-2018.9.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_process_net_command.py", line 841, in process_net_command
    py_db.writer.add_command(cmd)
  File "c:\Users\kyrus\.vscode\extensions\ms-python.python-2018.9.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_comm.py", line 448, in add_command
    self.cmdQueue.put(cmd)
AttributeError: 'Queue' object has no attribute 'put'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\Users\kyrus\.vscode\extensions\ms-python.python-2018.9.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_comm.py", line 411, in _on_run
    self.process_command(cmd_id, int(args[1]), args[2])
  File "c:\Users\kyrus\.vscode\extensions\ms-python.python-2018.9.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_comm.py", line 426, in process_command
    self.process_net_command(self.global_debugger_holder.global_dbg, cmd_id, seq, text)
  File "c:\Users\kyrus\.vscode\extensions\ms-python.python-2018.9.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_process_net_command.py", line 859, in process_net_command
    py_db.writer.add_command(cmd)
  File "c:\Users\kyrus\.vscode\extensions\ms-python.python-2018.9.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_comm.py", line 448, in add_command
    self.cmdQueue.put(cmd)
AttributeError: 'Queue' object has no attribute 'put'
Can't process net command: 501  1000000000      1.1     WINDOWS ID
Traceback (most recent call last):
Traceback (most recent call last):
Traceback (most recent call last):
Traceback (most recent call last):
Exception in thread pydevd.Reader:
Traceback (most recent call last):
  File "c:\Users\kyrus\.vscode\extensions\ms-python.python-2018.9.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_process_net_command.py", line 841, in process_net_command
    py_db.writer.add_command(cmd)
  File "c:\Users\kyrus\.vscode\extensions\ms-python.python-2018.9.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_comm.py", line 448, in add_command
    self.cmdQueue.put(cmd)
AttributeError: 'Queue' object has no attribute 'put'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\Users\kyrus\.vscode\extensions\ms-python.python-2018.9.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_comm.py", line 411, in _on_run
    self.process_command(cmd_id, int(args[1]), args[2])
  File "c:\Users\kyrus\.vscode\extensions\ms-python.python-2018.9.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_comm.py", line 426, in process_command
    self.process_net_command(self.global_debugger_holder.global_dbg, cmd_id, seq, text)
  File "c:\Users\kyrus\.vscode\extensions\ms-python.python-2018.9.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_process_net_command.py", line 845, in process_net_command
    traceback.print_exc()
  File "C:\Python\Python37-32\lib\traceback.py", line 159, in print_exc
    print_exception(*sys.exc_info(), limit=limit, file=file, chain=chain)
  File "C:\Python\Python37-32\lib\traceback.py", line 101, in print_exception
    print(line, file=file, end="")
  File "c:\Users\kyrus\.vscode\extensions\ms-python.python-2018.9.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_io.py", line 30, in write
    r.write(s)
  File "c:\Users\kyrus\.vscode\extensions\ms-python.python-2018.9.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\pydevd.py", line 1242, in write
    py_db.writer.add_command(cmd)
  File "c:\Users\kyrus\.vscode\extensions\ms-python.python-2018.9.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_comm.py", line 448, in add_command
    self.cmdQueue.put(cmd)
AttributeError: 'Queue' object has no attribute 'put'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\Users\kyrus\.vscode\extensions\ms-python.python-2018.9.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_comm.py", line 413, in _on_run
    traceback.print_exc()
  File "C:\Python\Python37-32\lib\traceback.py", line 159, in print_exc
    print_exception(*sys.exc_info(), limit=limit, file=file, chain=chain)
  File "C:\Python\Python37-32\lib\traceback.py", line 101, in print_exception
    print(line, file=file, end="")
  File "c:\Users\kyrus\.vscode\extensions\ms-python.python-2018.9.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_io.py", line 30, in write
    r.write(s)
  File "c:\Users\kyrus\.vscode\extensions\ms-python.python-2018.9.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\pydevd.py", line 1242, in write
    py_db.writer.add_command(cmd)
  File "c:\Users\kyrus\.vscode\extensions\ms-python.python-2018.9.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_comm.py", line 448, in add_command
    self.cmdQueue.put(cmd)
AttributeError: 'Queue' object has no attribute 'put'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\Users\kyrus\.vscode\extensions\ms-python.python-2018.9.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_comm.py", line 321, in run
    self._on_run()
  File "c:\Users\kyrus\.vscode\extensions\ms-python.python-2018.9.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_comm.py", line 418, in _on_run
    traceback.print_exc()
  File "C:\Python\Python37-32\lib\traceback.py", line 159, in print_exc
    print_exception(*sys.exc_info(), limit=limit, file=file, chain=chain)
  File "C:\Python\Python37-32\lib\traceback.py", line 101, in print_exception
    print(line, file=file, end="")
  File "c:\Users\kyrus\.vscode\extensions\ms-python.python-2018.9.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_io.py", line 30, in write
    r.write(s)
  File "c:\Users\kyrus\.vscode\extensions\ms-python.python-2018.9.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\pydevd.py", line 1242, in write
    py_db.writer.add_command(cmd)
  File "c:\Users\kyrus\.vscode\extensions\ms-python.python-2018.9.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_comm.py", line 448, in add_command
    self.cmdQueue.put(cmd)
AttributeError: 'Queue' object has no attribute 'put'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Python\Python37-32\lib\threading.py", line 917, in _bootstrap_inner
    self.run()
  File "c:\Users\kyrus\.vscode\extensions\ms-python.python-2018.9.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_comm.py", line 324, in run
    traceback.print_exc()
  File "C:\Python\Python37-32\lib\traceback.py", line 159, in print_exc
    print_exception(*sys.exc_info(), limit=limit, file=file, chain=chain)
  File "C:\Python\Python37-32\lib\traceback.py", line 101, in print_exception
    print(line, file=file, end="")
  File "c:\Users\kyrus\.vscode\extensions\ms-python.python-2018.9.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_io.py", line 30, in write
    r.write(s)
  File "c:\Users\kyrus\.vscode\extensions\ms-python.python-2018.9.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\pydevd.py", line 1242, in write
    py_db.writer.add_command(cmd)
  File "c:\Users\kyrus\.vscode\extensions\ms-python.python-2018.9.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_comm.py", line 448, in add_command
    self.cmdQueue.put(cmd)
AttributeError: 'Queue' object has no attribute 'put'
Unhandled exception in thread started by Unhandled exception in thread started by <bound method Thread._bootstrap of <ReaderThread(pydevd.Reader, started daemon 1916)>>

Traceback (most recent call last):


During handling of the above exception, another exception occurred:



During handling of the above exception, another exception occurred:



During handling of the above exception, another exception occurred:



During handling of the above exception, another exception occurred:



During handling of the above exception, another exception occurred:


Traceback (most recent call last):

Traceback (most recent call last):
Exception in thread pydevd.CheckAliveThread:
Traceback (most recent call last):
  File "c:\Users\kyrus\.vscode\extensions\ms-python.python-2018.9.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_comm.py", line 321, in run
    self._on_run()
  File "c:\Users\kyrus\.vscode\extensions\ms-python.python-2018.9.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\pydevd.py", line 185, in _on_run
    if not self.py_db.has_threads_alive() and self.py_db.writer.empty():
  File "c:\Users\kyrus\.vscode\extensions\ms-python.python-2018.9.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_comm.py", line 488, in empty
    return self.cmdQueue.empty()
AttributeError: 'Queue' object has no attribute 'empty'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Python\Python37-32\lib\threading.py", line 917, in _bootstrap_inner
    self.run()
  File "c:\Users\kyrus\.vscode\extensions\ms-python.python-2018.9.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_comm.py", line 324, in run
    traceback.print_exc()
  File "C:\Python\Python37-32\lib\traceback.py", line 159, in print_exc
    print_exception(*sys.exc_info(), limit=limit, file=file, chain=chain)
  File "C:\Python\Python37-32\lib\traceback.py", line 101, in print_exception
    print(line, file=file, end="")
  File "c:\Users\kyrus\.vscode\extensions\ms-python.python-2018.9.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_io.py", line 30, in write
    r.write(s)
  File "c:\Users\kyrus\.vscode\extensions\ms-python.python-2018.9.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\pydevd.py", line 1242, in write
    py_db.writer.add_command(cmd)
  File "c:\Users\kyrus\.vscode\extensions\ms-python.python-2018.9.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_comm.py", line 448, in add_command
    self.cmdQueue.put(cmd)
AttributeError: 'Queue' object has no attribute 'put'
Unhandled exception in thread started by Unhandled exception in thread started by <_pydev_bundle.pydev_monkey._NewThreadStartupWithTrace object at 0x0405B7F0>

Traceback (most recent call last):


During handling of the above exception, another exception occurred:



During handling of the above exception, another exception occurred:


Unhandled exception in thread started by Unhandled exception in thread started by <_pydev_bundle.pydev_monkey._NewThreadStartupWithTrace object at 0x04096B10>

Traceback (most recent call last):

Update: The problem still persists, but I've noticed another area where it seems to throw an similar error regarding python (relating to the 'Queue' object). Whenever I try to install a linter, it throws the following error in the terminal:

PS C:\Coding\Codecademy\Python> & C:/Python/Python37/python.exe -m pip install -U pep8 --user
Traceback (most recent call last):
  File "C:\Python\Python37\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Python\Python37\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Python\Python37\lib\site-packages\pip\__main__.py", line 16, in <module>
    from pip._internal import main as _main  # noqa
  File "C:\Python\Python37\lib\site-packages\pip\_internal\__init__.py", line 20, in <module>
    from pip._vendor.urllib3.exceptions import DependencyWarning
  File "C:\Python\Python37\lib\site-packages\pip\_vendor\urllib3\__init__.py", line 8, in <module>
    from .connectionpool import (
  File "C:\Python\Python37\lib\site-packages\pip\_vendor\urllib3\connectionpool.py", line 58, in <module>
    class ConnectionPool(object):
  File "C:\Python\Python37\lib\site-packages\pip\_vendor\urllib3\connectionpool.py", line 65, in ConnectionPool
    QueueCls = queue.LifoQueue
AttributeError: module 'queue' has no attribute 'LifoQueue'
PS C:\Coding\Codecademy\Python>
2
  • Looks like something went terribly wrong with VS code and Python today: stackoverflow.com/questions/52873612 Commented Oct 18, 2018 at 13:17
  • Ever found out what was the problem? Commented Jun 9, 2020 at 13:30

2 Answers 2

1

Try checking your python version I faced similar errors when I was trying to run my python3 code in VScode. Try changing the python version in vscode.

Sign up to request clarification or add additional context in comments.

6 Comments

I tried 3.6 just now and the same error occurred. As I mentioned before, the debugger worked less than 24hrs ago with the exact same version of python.
try some other version.
Switching versions does not fix the problem.
Try to run your code in Linux using virtual environment.
How is this even related to my problem? I can run the code fine using command line. The issue is with VSCode and python. I can't debug or install linters (and I assume other things). This occurred on both my laptop and desktop at the same time. This is after everything was working fine a day ago.
|
0

If this helps anyone, I had a situation where all of a sudden my Python code didn't seem to be debugging In VS Code anymore. There would be a brief change of color in the status bar at bottom and that's all. It turned out to be due to a blank line accidentally getting inserted into the code before the line containing "main()". I removed it and voila!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.