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

IPython crashes when I import numpy #12880

Closed
FANGOD opened this issue Apr 2, 2021 · 1 comment
Closed

IPython crashes when I import numpy #12880

FANGOD opened this issue Apr 2, 2021 · 1 comment
Milestone

Comments

@FANGOD
Copy link

FANGOD commented Apr 2, 2021

Python 3.6.8 (default, Apr 2 2020, 13:34:55)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.16.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor

In [2]: import numpy as np
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/IPython/terminal/ptutils.py", line 113, in get_completions
yield from self._get_completions(body, offset, cursor_position, self.ipy_completer)
File "/usr/local/lib/python3.6/site-packages/IPython/terminal/ptutils.py", line 126, in _get_completions
for c in completions:
File "/usr/local/lib/python3.6/site-packages/IPython/core/completer.py", line 438, in _deduplicate_completions
completions = list(completions)
File "/usr/local/lib/python3.6/site-packages/IPython/core/completer.py", line 1818, in completions
for c in self._completions(text, offset, _timeout=self.jedi_compute_type_timeout/1000):
File "/usr/local/lib/python3.6/site-packages/IPython/core/completer.py", line 1862, in _completions
full_text=full_text, cursor_line=cursor_line, cursor_pos=cursor_column)
File "/usr/local/lib/python3.6/site-packages/IPython/core/completer.py", line 2030, in _complete
cursor_pos, cursor_line, full_text)
File "/usr/local/lib/python3.6/site-packages/IPython/core/completer.py", line 1374, in _jedi_matches
text[:offset], namespaces, column=cursor_column, line=cursor_line + 1)
File "/usr/local/lib/python3.6/site-packages/jedi/api/init.py", line 726, in init
project=Project(Path.cwd()), **kwds)
TypeError: init() got an unexpected keyword argument 'column'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/bin/ipython", line 8, in
sys.exit(start_ipython())
File "/usr/local/lib/python3.6/site-packages/IPython/init.py", line 126, in start_ipython
return launch_new_instance(argv=argv, **kwargs)
File "/usr/local/lib/python3.6/site-packages/traitlets/config/application.py", line 664, in launch_instance
app.start()
File "/usr/local/lib/python3.6/site-packages/IPython/terminal/ipapp.py", line 356, in start
self.shell.mainloop()
File "/usr/local/lib/python3.6/site-packages/IPython/terminal/interactiveshell.py", line 563, in mainloop
self.interact()
File "/usr/local/lib/python3.6/site-packages/IPython/terminal/interactiveshell.py", line 546, in interact
code = self.prompt_for_code()
File "/usr/local/lib/python3.6/site-packages/IPython/terminal/interactiveshell.py", line 474, in prompt_for_code
**self._extra_prompt_options())
File "/usr/local/lib/python3.6/site-packages/prompt_toolkit/shortcuts/prompt.py", line 1021, in prompt
set_exception_handler=set_exception_handler, in_thread=in_thread
File "/usr/local/lib/python3.6/site-packages/prompt_toolkit/application/application.py", line 888, in run
self.run_async(pre_run=pre_run, set_exception_handler=set_exception_handler)
File "/usr/lib64/python3.6/asyncio/base_events.py", line 484, in run_until_complete
return future.result()
File "/usr/local/lib/python3.6/site-packages/prompt_toolkit/application/application.py", line 816, in run_async
return await _run_async2()
File "/usr/local/lib/python3.6/site-packages/prompt_toolkit/application/application.py", line 798, in _run_async2
await self.cancel_and_wait_for_background_tasks()
File "/usr/local/lib/python3.6/site-packages/prompt_toolkit/application/application.py", line 945, in cancel_and_wait_for_background_tasks
await task
File "/usr/local/lib/python3.6/site-packages/prompt_toolkit/buffer.py", line 1909, in new_coroutine
await coroutine(*a, **kw)
File "/usr/local/lib/python3.6/site-packages/prompt_toolkit/buffer.py", line 1739, in async_completer
document, complete_event
File "/usr/local/lib/python3.6/site-packages/prompt_toolkit/completion/base.py", line 272, in get_completions_async
document, complete_event
File "/usr/local/lib/python3.6/site-packages/prompt_toolkit/completion/base.py", line 198, in get_completions_async
for item in self.get_completions(document, complete_event):
File "/usr/local/lib/python3.6/site-packages/IPython/terminal/ptutils.py", line 116, in get_completions
print_tb(e)
File "/usr/lib64/python3.6/traceback.py", line 53, in print_tb
print_list(extract_tb(tb, limit=limit), file=file)
File "/usr/lib64/python3.6/traceback.py", line 72, in extract_tb
return StackSummary.extract(walk_tb(tb), limit=limit)
File "/usr/lib64/python3.6/traceback.py", line 345, in extract
for f, lineno in frame_gen:
File "/usr/lib64/python3.6/traceback.py", line 310, in walk_tb
yield tb.tb_frame, tb.tb_lineno
AttributeError: 'TypeError' object has no attribute 'tb_frame'

If you suspect this is an IPython 7.16.1 bug, please report it at:
https://github.com/ipython/ipython/issues
or send an email to the mailing list at ipython-dev@python.org

You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.

Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
%config Application.verbose_crash=True

@MrMino
Copy link
Member

MrMino commented Apr 2, 2021

Hi. Please try to downgrade Jedi and see if the problem persists:

pip install jedi==0.17.2

I think this is the problem that has been fixed in IPython 7.20 (#12793), but it's not available for your Python version. I'll close this for now, as it looks like a duplicate, but if the workaround above does not fix your problem - feel free to ping me here, I'll reopen & try to help you further.

@MrMino MrMino closed this as completed Apr 2, 2021
@MrMino MrMino added this to the no action milestone Apr 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants