zsh命令找不到pip [英] zsh command cannot found pip

查看:410
本文介绍了zsh命令找不到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

推荐答案

也许您已经安装了python2python3. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆