2016-03-31 7 views
1

オクラホマ私は今この問題を少しでも抱えており、私は迷っています。Jupyter QtConsole syntaxerror with matplotlib inline

私はJupyter QtConsoleを実行していて、Pythonスクリプトを実行しようとしています。

from __future__ import division 
from ipywidgets import * 
import numpy as np 
import matplotlib.pyplot as p 
%matplotlib inline 

QtConsoleは私にエラーを与え続け:

run test.py 
    File "/home/Bob/Desktop/test.py", line 5 
    %matplotlib inline 
    ^
SyntaxError: invalid syntax 

私は、これはIpython特定のコードであり、それは私がターミナルとタイピングに行くことによってロードされJupyter QtConsoleで動作するはず読んだから:

[email protected]:~/Desktop$ jupyter qtconsole 

これは端末にこれを与えますが、qtconsoleをロードします。

/usr/local/lib/python2.7/dist-packages/IPython/paths.py:62: UserWarning: IPython dir '/home/bob/.ipython' is not a writable location, using a temp directory. 
    " using a temp directory.".format(ipdir)) 
Bus::open: Can not get ibus-daemon's address. 
IBusInputContext::createInputContext: no connection to ibus-daemon 
/usr/local/lib/python2.7/dist-packages/IPython/paths.py:62: UserWarning: IPython dir '/home/bob/.ipython' is not a writable location, using a temp directory. 
    " using a temp directory.".format(ipdir)) 

お願いします。

答えて

0

qtconsoleを起動したら、コンソールで%matplotlib inlineと入力します。その後、すべてのプロットがインラインで表示されます。

これが役に立ちます。

関連する問題