2016-11-24 185 views
1

我在Ubuntu16.04上使用PyCharm Community Edition2016.2.3。IPython.core.error.UsageError:在启用gui之前,必须提供return_control_callback作为参考

我配置后显示命令行。 当我尝试:

import matplotlib.pyplot as plt 

我得到了IPython.core.error.UsageError

/usr/bin/python3.5 /root/download/pycharm-community-2016.2.3/helpers/pydev/pydev_run_in_console.py 39312 40450 /root/PycharmProjects/mytflayer/myVQA.py 
Python 3.5.2 (default, Sep 10 2016, 08:21:44) 
Type "copyright", "credits" or "license" for more information. 

IPython 5.1.0 -- An enhanced Interactive Python. 
?   -> Introduction and overview of IPython's features. 
%quickref -> Quick reference. 
help  -> Python's own help system. 
object? -> Details about 'object', use 'object??' for extra details. 
PyDev console: using IPython 5.1.0 
Running /root/PycharmProjects/mytflayer/myVQA.py 
Traceback (most recent call last): 
    File "/root/download/pycharm-community-2016.2.3/helpers/pydev/_pydev_bundle/pydev_ipython_console_011.py", line 123, in enable_gui 
    return real_enable_gui(gui, app) 
    File "/root/download/pycharm-community-2016.2.3/helpers/pydev/pydev_ipython/inputhook.py", line 488, in enable_gui 
    raise ValueError("A return_control_callback must be supplied as a reference before a gui can be enabled") 
ValueError: A return_control_callback must be supplied as a reference before a gui can be enabled 

During handling of the above exception, another exception occurred: 

Traceback (most recent call last): 
    File "/root/download/pycharm-community-2016.2.3/helpers/pydev/pydev_run_in_console.py", line 71, in <module> 
    globals = run_file(file, None, None) 
    File "/root/download/pycharm-community-2016.2.3/helpers/pydev/pydev_run_in_console.py", line 31, in run_file 
    pydev_imports.execfile(file, globals, locals) # execute the script 
    File "/root/download/pycharm-community-2016.2.3/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile 
    exec(compile(contents+"\n", file, 'exec'), glob, loc) 
    File "/root/PycharmProjects/mytflayer/myVQA.py", line 4, in <module> 
    import matplotlib.pyplot as plt 
    File "/usr/local/lib/python3.5/dist-packages/matplotlib/pyplot.py", line 2512, in <module> 
    install_repl_displayhook() 
    File "/usr/local/lib/python3.5/dist-packages/matplotlib/pyplot.py", line 165, in install_repl_displayhook 
    ip.enable_gui(ipython_gui_name) 
    File "/root/download/pycharm-community-2016.2.3/helpers/pydev/_pydev_bundle/pydev_ipython_console_011.py", line 125, in enable_gui 
    raise UsageError("%s" % e) 
IPython.core.error.UsageError: A return_control_callback must be supplied as a reference before a gui can be enabled 

如果我不配置显示coomand线之后,一切工作正常。 预先感谢您。

回答

1

我解决我的问题,通过安装PyCharm-2016.3

-2

我解决它,当我使用调试,而不是运行它。

+0

但它真的有效! – Eugenie

0

如果升级不起作用,请尝试以下解决方法:

只需取消选中“显示命令行继”对话框中的配置设置。 Ref

+0

这不提供问题的答案。一旦你有足够的[声誉](https://stackoverflow.com/help/whats-reputation),你将可以[对任何帖子发表评论](https://stackoverflow.com/help/privileges/comment);相反,[提供不需要提问者澄清的答案](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-c​​an- I-DO-代替)。 - [来自评论](/ review/low-quality-posts/18757233) –

+0

尽管此链接可能回答问题,但最好在此处包含答案的基本部分,并提供供参考的链接。如果链接页面更改,则仅链接答案可能会失效。 - [来自评论](/ review/low-quality-posts/18757233) – Dez

相关问题