我在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線之後,一切工作正常。 預先感謝您。
但它真的有效! – Eugenie