ImportError: Ipython には Python バージョン 2.7 または 3.3 以上が必要です

ImportError: Ipython には Python バージョン 2.7 または 3.3 以上が必要です

ipython ノートブックを使用しようとしています。しかし、ipython ノートブックを実行すると、以下のエラーが発生します。ipython 2.7 と 3.3 の両方を持っています。しかし、それでも ipython 2.7 を検出できません。以前のパスを削除せずにパスを追加するにはどうすればよいでしょうか。

ihn@cri8:/home/ihn/packages$ ipython notebook
Traceback (most recent call last):
 File "/usr/local/bin/ipython", line 7, in <module>
from IPython import start_ipython
 File "/usr/local/lib/python3.2/dist-packages/IPython/__init__.py", line 33, in <module>
raise ImportError('IPython requires Python version 2.7 or 3.3 or above.')
ImportError: IPython requires Python version 2.7 or 3.3 or above.

入力すると

$ which python
/usr/bin/python

$ python -V
Python 2.7.3

EXPORT = path $path を使用できます。ただし、その場合、bashrc ファイル内の以前のパスが削除されます。このパスを追加するにはどうすればよいでしょうか?

答え1

Ubuntu 20.04以降

ターミナルを開いて次のように入力します:

sudo apt install jupyter-notebook jupyter

Ubuntu 18.04以降

sudo apt install python3-notebook jupyter jupyter-core python-ipykernel

ノートブック サーバーを起動するには、次のコマンドを実行します。

jupyter notebook

Web ブラウザで Jupyter Notebook が開いているのが確認できます。


ターミナルを開いて次のように入力します:

sudo apt-get install ipython3 ipython3-notebook  

インタラクティブ Python 3 HTML ノートブックを起動するには、次のように入力します。

ipython3 notebook  

インラインPythonベースのプロットシステムを備えたPythonノートブックを起動するには(Python-matplotlib の):

ipython notebook --pylab  

または Python 3 および python3-matplotlib の場合:

ipython3 notebook --pylab

関連情報