zsh命令找不到pip [英] zsh command cannot found pip
问题描述
如何在oh-my-zsh中使用pip
?我试图通过pip安装nltk
,但是它告诉了我zsh: command not found: pip
.当我检查.oh-my-zsh/custom/plugins
下的插件时,有一个名为pip
的文件夹.我不知道问题是什么.
How can I use pip
in oh-my-zsh? I was trying to install nltk
through pip, but it told me zsh: command not found: pip
. When I check plugins under .oh-my-zsh/custom/plugins
, there is a folder named pip
. I don't know what the problem is.
修改:
$ echo $PATH
/home/xxx/bin:/usr/local/bin:/home/xxx/bin:/home/xxx/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
$ type pip
pip is an alias for noglob pip
推荐答案
也许您已经安装了python2
和python3
. python3
可能稍后安装.
Maybe you have installed both python2
and python3
. python3
may have been installed later.
您可以尝试使用pip3
代替pip
.
首先,输入命令:
pip3 -V
如果看到版本,则可以使用pip3
.
If you see the version, the pip3
can be used.
然后您可以输入命令行来安装nltk
:
Then you can input command line to install nltk
:
pip3 install nltk
我有一种方法可以帮助您在zsh中使用pip. 我们可以使用nano
编辑文件.在nano中, ctrl + X 保存并退出
I got a way to help you use pip in zsh. We can use nano
to edit files. In nano, ctrl+X to save and exit
在~
目录中,输入命令:
nano .bash_profile
您可能会看到一些代码,例如:
You may see some codes like:
# Setting PATH for Python 3.5
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.5/bin:${PATH}"
export PATH
使用以下命令将它们复制并粘贴到.zshrc
文件的末尾:
Copy them and paste them to the end of .zshrc
file by using command:
nano .zshrc
然后输入命令:
pip -V
如果看到版本,则可以使用pip
.
If you see the version, pip
can be used.
这篇关于zsh命令找不到pip的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!