tonybaloney / instaviz

Instant visualization of Python AST and Code Objects
Apache License 2.0
129 stars 18 forks source link

Missing requirement - pyreadline #10

Open petermcd opened 4 years ago

petermcd commented 4 years ago

When trying to run instaviz after installing using 'pip install instaviz' the following behaviour is observered:

``C:\Users\pete>python Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) [MSC v.1924 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

import instaviz def example(): ... a= 1 ... be = a + 1 ... return be ... instaviz.show(example) Traceback (most recent call last): File "", line 1, in File "C:\Users\pete\AppData\Local\Programs\Python\Python38\lib\site-packages\instaviz__init__.py", line 18, in show show_code_object(obj, instructions) File "C:\Users\pete\AppData\Local\Programs\Python\Python38\lib\site-packages\instaviz\web.py", line 111, in show_code_object (lines, start_line) = source.getsourcelines(obj) File "C:\Users\pete\AppData\Local\Programs\Python\Python38\lib\site-packages\dill\source.py", line 325, in getsourcelines code, n = getblocks(object, lstrip=lstrip, enclosing=enclosing, locate=True) File "C:\Users\pete\AppData\Local\Programs\Python\Python38\lib\site-packages\dill\source.py", line 251, in getblocks lines, lnum = findsource(object) File "C:\Users\pete\AppData\Local\Programs\Python\Python38\lib\site-packages\dill\source.py", line 129, in findsource raise IOError(err) OSError: No module named 'readline', please install 'pyreadline' exit()``

Environment OS: Windows 10 Python: 3.8.3 Install Method: EXE

After installing pyreadline the issue is resolved.

Looking at the requirements for Dill pyreadline is mentioned as an optional requirement therefore does not install it by default