跳到主要内容

ipython 版本安装与启动

ipython 安装后命令行无法启动

ipython已经安装, 但是执行ipython报错ipython: command not found, 这时候可以使用python3 -m IPython进行触发启动.

为了支持ipython命令, 可以在.bashrc or .bash_profile中配置alias ipython='python3 -m IPython'

测试记录


# ipython已经安装
ubuntu@ca39d45d1796:~/project/geedeploy/dev$ pip install ipython
Looking in indexes: http://mirrors.tencentyun.com/pypi/simple
Requirement already satisfied: ipython in /home/coder/.local/lib/python3.9/site-packages (8.14.0)
Requirement already satisfied: stack-data in /home/coder/.local/lib/python3.9/site-packages (from ipython) (0.6.2)
Requirement already satisfied: matplotlib-inline in /home/coder/.local/lib/python3.9/site-packages (from ipython) (0.1.6)
Requirement already satisfied: prompt-toolkit!=3.0.37,<3.1.0,>=3.0.30 in /home/coder/.local/lib/python3.9/site-packages (from ipython) (3.0.39)
Requirement already satisfied: pexpect>4.3 in /home/coder/.local/lib/python3.9/site-packages (from ipython) (4.8.0)
Requirement already satisfied: traitlets>=5 in /home/coder/.local/lib/python3.9/site-packages (from ipython) (5.9.0)
Requirement already satisfied: pickleshare in /home/coder/.local/lib/python3.9/site-packages (from ipython) (0.7.5)
Requirement already satisfied: jedi>=0.16 in /home/coder/.local/lib/python3.9/site-packages (from ipython) (0.19.0)
Requirement already satisfied: pygments>=2.4.0 in /home/coder/.local/lib/python3.9/site-packages (from ipython) (2.16.1)
Requirement already satisfied: decorator in /home/coder/.local/lib/python3.9/site-packages (from ipython) (5.1.1)
Requirement already satisfied: backcall in /home/coder/.local/lib/python3.9/site-packages (from ipython) (0.2.0)
Requirement already satisfied: typing-extensions in /home/coder/.local/lib/python3.9/site-packages (from ipython) (4.7.1)
Requirement already satisfied: parso<0.9.0,>=0.8.3 in /home/coder/.local/lib/python3.9/site-packages (from jedi>=0.16->ipython) (0.8.3)
Requirement already satisfied: ptyprocess>=0.5 in /home/coder/.local/lib/python3.9/site-packages (from pexpect>4.3->ipython) (0.7.0)
Requirement already satisfied: wcwidth in /home/coder/.local/lib/python3.9/site-packages (from prompt-toolkit!=3.0.37,<3.1.0,>=3.0.30->ipython) (0.2.6)
Requirement already satisfied: asttokens>=2.1.0 in /home/coder/.local/lib/python3.9/site-packages (from stack-data->ipython) (2.2.1)
Requirement already satisfied: executing>=1.2.0 in /home/coder/.local/lib/python3.9/site-packages (from stack-data->ipython) (1.2.0)
Requirement already satisfied: pure-eval in /home/coder/.local/lib/python3.9/site-packages (from stack-data->ipython) (0.2.2)
Requirement already satisfied: six in /home/coder/.local/lib/python3.9/site-packages (from asttokens>=2.1.0->stack-data->ipython) (1.16.0)


# 无法启动ipython
ubuntu@ca39d45d1796:~/project/geedeploy/dev$ ipython
bash: ipython: command not found

# 使用 python3 -m IPython 启动ipython
ubuntu@ca39d45d1796:~/project/geedeploy/dev$ python3 -m IPython
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
Type 'copyright', 'credits' or 'license' for more information
IPython 8.14.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]:
alias ipython='python -m IPython'

参考 iPython installed but not found

https://stackoverflow.com/questions/34441943/ipython-installed-but-not-found