2016-11-24 67 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

相關問題