Open excalamus opened 4 years ago
https://en.wikipedia.org/wiki/Windows_Terminal claims that Windows Terminal (the new one, not the old "Command Prompt" thing) supports ANSI sequences now, so that might actually work. Could you try?
I think it also works under WSL.
https://en.wikipedia.org/wiki/Windows_Terminal claims that Windows Terminal (the new one, not the old "Command Prompt" thing) supports ANSI sequences now, so that might actually work. Could you try?
Upgraded to Windows 10 1909 and installed Windows_Terminal. Same error:
(venv) PS C:\projects\tester> pip install pudb
Looking in indexes: https://pypi.org/simple, http://pypi/
Collecting pudb
07/pudb-2019.2.tar.gz
Collecting urwid>=1.1.1 (from pudb)
Using cached https://files.pythonhosted.org/packages/45/dd/d57924f77b0914f8a61c81222647888fbb583f89168a376ffeb5613b02from pudb import set_trace; set_trace()
Using cached https://files.pythonhosted.org/packages/be/39/32da3184734730c0e4d3fa3b2b5872104668ad6dc1b5a73d8e477e5fe967/Pygments-2.5.2-py2.py3-none-any.whl
Installing collected packages: urwid, pygments, pudb
from pudb import set_trace; set_trace()
You are using pip version 18.1, however version 20.0.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
(venv) PS C:\projects\tester> echo "from pudb import set_trace; set_trace()" > myfile.py
(venv) PS C:\projects\tester> ls
Directory: C:\projects\tester
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 2/17/2020 2:53 PM venv
-a---- 2/17/2020 2:55 PM 84 myfile.py
(venv) PS C:\projects\tester> python .\myfile.py
File ".\myfile.py", line 1
SyntaxError: Non-UTF-8 code starting with '\xff' in file .\myfile.py on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
(venv) PS C:\projects\tester> vim .\myfile.py
(venv) PS C:\projects\tester> python myfile.py
File "myfile.py", line 1
SyntaxError: Non-UTF-8 code starting with '\xff' in file myfile.py on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
(venv) PS C:\projects\tester> touch nother.py
(venv) PS C:\projects\tester> vim .\nother.py
(venv) PS C:\projects\tester> python .\nother.py
Traceback (most recent call last):
File ".\nother.py", line 1, in <module>
from pudb import set_trace; set_trace()
File "C:\projects\tester\venv\lib\site-packages\pudb\__init__.py", line 232, in set_trace
dbg = _get_debugger()
File "C:\projects\tester\venv\lib\site-packages\pudb\__init__.py", line 110, in _get_debugger
dbg = Debugger(**kwargs)
File "C:\projects\tester\venv\lib\site-packages\pudb\debugger.py", line 166, in __init__
self.ui = DebuggerUI(self, stdin=stdin, stdout=stdout, term_size=term_size)
File "C:\projects\tester\venv\lib\site-packages\pudb\debugger.py", line 1962, in __init__
self.screen = ThreadsafeRawScreen()
File "C:\projects\tester\venv\lib\site-packages\urwid\raw_display.py", line 92, in __init__
fcntl.fcntl(self._resize_pipe_rd, fcntl.F_SETFL, os.O_NONBLOCK)
NameError: name 'fcntl' is not defined
I notice now that pudb
only supports up to Python 3.5 (from PyPi). That might be worth putting in the README, too.
For kicks I tried it with Python 3.4:
(py34) PS C:\projects\tester> python -V
Python 3.4.4
(py34) PS C:\projects\tester> pip install pudb
Collecting pudb
Downloading https://files.pythonhosted.org/packages/10/dc/a4933487ea8322336d3827c1193fff0ddd8b3a43eeda3f446f163dacc407/pudb-2019.2.tar.gz (59kB)
100% |################################| 61kB 996kB/s
Collecting urwid>=1.1.1 (from pudb)
Downloading https://files.pythonhosted.org/packages/45/dd/d57924f77b0914f8a61c81222647888fbb583f89168a376ffeb5613b02a 100% |################################| 630kB 555kB/s
Collecting pygments>=1.0 (from pudb)
Downloading https://files.pythonhosted.org/packages/be/39/32da3184734730c0e4d3fa3b2b5872104668ad6dc1b5a73d8e477e5fe967/Pygments-2.5.2-py2.py3-none-any.whl (896kB)
100% |################################| 897kB 570kB/s
Installing collected packages: urwid, pygments, pudb
Running setup.py install for urwid
Running setup.py install for pudb
Successfully installed pudb-2019.2 pygments-2.5.2 urwid-2.1.0
You are using pip version 7.1.2, however version 20.0.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
(py34) PS C:\projects\tester> python .\nother.py
Traceback (most recent call last):
File ".\nother.py", line 1, in <module>
from pudb import set_trace; set_trace()
File "C:\projects\tester\py34\lib\site-packages\pudb\__init__.py", line 232, in set_trace
dbg = _get_debugger()
File "C:\projects\tester\py34\lib\site-packages\pudb\__init__.py", line 110, in _get_debugger
dbg = Debugger(**kwargs)
File "C:\projects\tester\py34\lib\site-packages\pudb\debugger.py", line 166, in __init__
self.ui = DebuggerUI(self, stdin=stdin, stdout=stdout, term_size=term_size)
File "C:\projects\tester\py34\lib\site-packages\pudb\debugger.py", line 1962, in __init__
self.screen = ThreadsafeRawScreen()
File "C:\projects\tester\py34\lib\site-packages\urwid\raw_display.py", line 92, in __init__
fcntl.fcntl(self._resize_pipe_rd, fcntl.F_SETFL, os.O_NONBLOCK)
NameError: name 'fcntl' is not defined
Thanks for trying and relaying the results.
Could you try the curses display? (Edit $HOME/.config/pudb/pudb.cfg
to set display
to curses
.
The 3.x version specifics are outdated nonsense. I routinely use pudb with 3.7 and 3.8. 411614c gets rid of them.
I would also note here that the issue is with the urwid
library, not pudb. I believe PuDB should work just fine with Windows once urwid supports it.
No go with the curses
change.
(py34) PS C:\projects\tester> type $HOME/.config/pudb/pudb.cfg
[pudb]
breakpoints_weight = 1
current_stack_frame = top
custom_shell =
custom_stringifier =
custom_theme =
default_variables_access_level = public
display = curses
hide_cmdline_win = False
line_numbers = False
prompt_on_quit = True
seen_welcome = a
shell = internal
sidebar_width = 0.5
stack_weight = 1
stringifier = type
theme = classic
variables_weight = 1
wrap_variables = True
(py34) PS C:\projects\tester> python .\nother.py
Traceback (most recent call last):
File ".\nother.py", line 1, in <module>
from pudb import set_trace; set_trace()
File "C:\projects\tester\py34\lib\site-packages\pudb\__init__.py", line 232, in set_trace
dbg = _get_debugger()
File "C:\projects\tester\py34\lib\site-packages\pudb\__init__.py", line 110, in _get_debugger
dbg = Debugger(**kwargs)
File "C:\projects\tester\py34\lib\site-packages\pudb\debugger.py", line 166, in __init__
self.ui = DebuggerUI(self, stdin=stdin, stdout=stdout, term_size=term_size)
File "C:\projects\tester\py34\lib\site-packages\pudb\debugger.py", line 1962, in __init__
self.screen = ThreadsafeRawScreen()
File "C:\projects\tester\py34\lib\site-packages\urwid\raw_display.py", line 92, in __init__
fcntl.fcntl(self._resize_pipe_rd, fcntl.F_SETFL, os.O_NONBLOCK)
NameError: name 'fcntl' is not defined
Does import curses
succeed? It looks like you're still on the raw display:
File "C:\projects\tester\py34\lib\site-packages\urwid\raw_display.py", line 92, in __init__
fcntl.fcntl(self._resize_pipe_rd, fcntl.F_SETFL, os.O_NONBLOCK)
As far as I know, I'm using the preview terminal:
No go on the import curses
:
(py34) PS C:\projects\tester> type .\just_curses.py
import curses
(py34) PS C:\projects\tester> python .\just_curses.py
Traceback (most recent call last):
File ".\just_curses.py", line 1, in <module>
import curses
File "C:\python\python3.4.4-64\lib\curses\__init__.py", line 13, in <module>
from _curses import *
ImportError: No module named '_curses'
According to https://docs.python.org/3/howto/curses.html, the Windows build of Python doesn't include curses. It suggests you could use https://pypi.org/project/UniCurses/ instead.
UniCurses fails to install through pip
. Last update seems to be from 2014.
Reviews match my experience.
User Reviews
dazza000 Posted 11/18/2017
fails to run on python 3.5.4 Fatal error: can't find pdcurses.dll for linking, make sure PDCurses v3.4+ is in the same folder as UniCurses if you want to use UniCurses on a win32 platform. Traceback (most recent call last): File "C:\Users\david000\AppData\Local\Programs\Python\Python35-32\lib\site-packages\unicurses.py", line 43, in
import curses # see if the platform supports curses natively File "C:\Users\david000\AppData\Local\Programs\Python\Python35-32\lib\curses__init__.py", line 13, in from _curses import * ImportError: No... Read More » aa6e Posted 04/20/2016
Fails to install (Application Error) under Windows 10.
According to #257, Windows is not supported. I had mistakenly assumed it was since I saw Azure and DOS references. It doesn't seem like system requirements are indicated anywhere on the README.
I put a mention under "Features" for lack of a better place.
Respectfully, Matt