ImportError: Ipython 需要 Python 版本 2.7 或 3.3 或更高版本

ImportError: Ipython 需要 Python 版本 2.7 或 3.3 或更高版本

我正在嘗試使用 ipython 筆記本。但是當我執行 ipython Notebook 時,它給了以下錯誤。我有 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

您應該會看到 Jupyter Notebook 在 Web 瀏覽器中開啟。


打開終端機並輸入:

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

相關內容