Tôi đã cài đặt hệ điều hành cơ bản và Pycharm và toàn bộ ngăn xếp trăn qua conda
và hiện đang gặp trục trặc khi bắt đầu tương tác matplotlib trong đường dây ipython
.Sự kết hợp của PyCharm và ipython không nhập qt5 hoặc Qt5Agg
Dưới đây là phiên ipython pycharm của:
/home/foo/.conda/envs/myenv3/bin/python3.5 /opt/pycharm-2016.2.3/helpers/pydev/pydevconsole.py 41070 33134
Python 3.5.2 |Continuum Analytics, Inc.| (default, Jul 2 2016, 17:53:06)
Type "copyright", "credits" or "license" for more information.
IPython 5.0.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.0.0
import sys; print('Python %s on %s' % (sys.version, sys.platform))
Python 3.5.2 |Continuum Analytics, Inc.| (default, Jul 2 2016, 17:53:06)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Và đây là những gì xảy ra nếu tôi cố gắng nhập pyplot
:
In[4]: import matplotlib.pyplot as plt
Traceback (most recent call last):
File "/opt/pycharm-2016.2.3/helpers/pydev/pydev_ipython/inputhook.py", line 502, in enable_gui
gui_hook = guis[gui]
KeyError: 'qt5'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/pycharm-2016.2.3/helpers/pydev/_pydev_bundle/pydev_ipython_console_011.py", line 123, in enable_gui
return real_enable_gui(gui, app)
File "/opt/pycharm-2016.2.3/helpers/pydev/pydev_ipython/inputhook.py", line 508, in enable_gui
raise ValueError(e)
ValueError: Invalid GUI request 'qt5', valid ones are:dict_keys(['gtk3', 'wx', 'qt', 'osx', 'pyglet', 'glut', 'tk', 'gtk', 'none', 'qt4'])
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/foo/.conda/envs/myenv3/lib/python3.5/site-packages/IPython/core/interactiveshell.py", line 2869, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-4-eff513f636fd>", line 1, in <module>
import matplotlib.pyplot as plt
- Vấn đề này chỉ xảy ra khi
ipython
được cài đặt. Khi tôi không chọn ipython, tuy nhiên, tôi chỉ nhận được một màn hình đen không phản hồi khi tôiplt.figure()
. - Vấn đề này không xảy ra khi tôi bắt đầu
ipython
theo cách thủ công từ thiết bị đầu cuối (bên ngoài pycharm). Ngoài ra, nếu tôi làmmatplotlib.use('Qt5Agg')
trước khi nhậppyplot
, lỗi vẫn còn trong pycharm, nhưng không xuất hiện trong bảng điều khiển ipython trong thiết bị đầu cuối của tôi. - Cài đặt trên một môi trường conda mới sau
conda create -n test python=3.5 ; conda install ipython matplotlib scipy -n test
và tải các môi trường mới trong pycharm không giúp - Cài đặt lại pycharm 2.3 hoặc Vô hiệu hóa Caches + Khởi động lại không giúp
- Cài đặt pycharm giáo dục 3.0 không giúp
Tôi làm cách nào để làm việc này?