已安装ipython,但未找到

时间:2020-09-20 21:39:49

标签: python ipython oh-my-zsh

以下是来自zsh终端的文本,已安装ipython但未找到。需要帮忙。不能取消安装,因为找不到它。无法运行,因为找不到它。但是据bash说,它就在那里。

➜  green ipython
zsh: command not found: ipython
➜  green ipython3
zsh: command not found: ipython3
➜  green ipython --version
zsh: command not found: ipython
➜  green ipython3 --version
zsh: command not found: ipython3
➜  green pip3 install ipython
Requirement already satisfied: ipython in /home/joshuamwolfe/.local/lib/python3.8/site-packages (7.18.1)
Requirement already satisfied: pexpect>4.3; sys_platform != "win32" in /home/joshuamwolfe/.local/lib/python3.8/site-packages (from ipython) (4.8.0)
Requirement already satisfied: prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0 in /home/joshuamwolfe/.local/lib/python3.8/site-packages (from ipython) (3.0.7)
Requirement already satisfied: traitlets>=4.2 in /home/joshuamwolfe/.local/lib/python3.8/site-packages (from ipython) (5.0.4)
Requirement already satisfied: setuptools>=18.5 in /usr/lib/python3/dist-packages (from ipython) (45.2.0)
Requirement already satisfied: decorator in /home/joshuamwolfe/.local/lib/python3.8/site-packages (from ipython) (4.4.2)
Requirement already satisfied: jedi>=0.10 in /home/joshuamwolfe/.local/lib/python3.8/site-packages (from ipython) (0.17.2)
Requirement already satisfied: backcall in /home/joshuamwolfe/.local/lib/python3.8/site-packages (from ipython) (0.2.0)
Requirement already satisfied: pickleshare in /home/joshuamwolfe/.local/lib/python3.8/site-packages (from ipython) (0.7.5)
Requirement already satisfied: pygments in /home/joshuamwolfe/.local/lib/python3.8/site-packages (from ipython) (2.7.1)

更新:

有效的解决方案.... / facepalm

sudo pip3安装ipython

➜  ~ sudo pip3 install ipython
Collecting ipython
Successfully installed backcall-0.2.0 decorator-4.4.2 ipython-7.18.1 ipython-genutils-0.2.0 jedi-0.17.2 parso-0.7.1 pexpect-4.8.0 pickleshare-0.7.5 prompt-toolkit-3.0.7 ptyprocess-0.6.0 pygments-2.7.1 traitlets-5.0.4 wcwidth-0.2.5
➜  ~ ipython
Python 3.8.2 (default, Jul 16 2020, 14:00:26)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.18.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]:

iPython installed but not found

原因我没有使用上面的链接作为解决方案:

  • 主要原因是%python -m IPython确实响应,zsh认为未安装。
  • 我在用我的zosh。
  • +5的回答:Parth92,让我暂停关注。

2 个答案:

答案 0 :(得分:1)

如果您是初学者,请进行全局安装,减少出错的机会。

sudo pip3 install ipython3

答案 1 :(得分:0)

与Debian Buster同样,我在~/.local/bin中放了PATH,并且效果很好。 因此,在使用pip install ipython命令安装ipython之后,将此行添加到您的~/.profile中:

export PATH="$PATH:~/.local/bin/"

您可能需要首先获取.profile的资源,我不是。