pip3:找不到命令 [英] pip3: command not found

查看:2034
本文介绍了pip3:找不到命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想按照以下说明安装Tensorflow. https://www.tensorflow.org/versions/r0.12/get_started /os_setup#pip_installation .

I want to install Tensorflow following this instructions. https://www.tensorflow.org/versions/r0.12/get_started/os_setup#pip_installation.

但是当我在终端上尝试此代码时,它将返回错误.

But when I try this code on terminal, it returns an error.

$ sudo pip3 install --upgrade $TF_BINARY_URL
sudo: pip3: command not found

所以我安装了Homebrew,并尝试卸载并重新安装pip-3,但没有用.

So I installed Homebrew and tried to uninstall and reinstall pip-3, but didn't work.

MakotonoMacBook-ea:~ makotomiyazaki$ brew uninstall python3-pip
Error: No such keg: /usr/local/Cellar/python3-pip

MakotonoMacBook-ea:~ makotomiyazaki$ brew install python3-pip
Error: No available formula with the name "python3-pip" 
==> Searching for a previously deleted formula...
Warning: homebrew/core is shallow clone. To get complete history run:
  git -C "$(brew --repo homebrew/core)" fetch --unshallow

我应该怎么做才能获得pip3? 我的操作系统是macOS High Sierra,并且我已经安装了python 3.6.2.

What should I do for getting pip3? My OS is macOS High Sierra, and I have python 3.6.2 already installed.

我尝试过

python3 -m pip

返回的是这个.

The directory '/Users/makotomiyazaki/Library/Caches/pip/http' or its 
parent directory is not owned by the current user and the cache has 
been disabled. Please check the permissions and owner of that 
directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/makotomiyazaki/Library/Caches/pip' or its parent 
directory is not owned by the current user and caching wheels has been 
disabled. check the permissions and owner of that directory. If 
executing pip with sudo, you may want sudo's -H flag.
You must give at least one requirement to install (see "pip help 
install")

我也尝试了哪个pip3,但我不知道它是否有效...

I also tried which pip3, but just I don't know if it worked...

MakotonoMacBook-ea:~ makotomiyazaki$ sudo which pip3 install --upgrade $TF_BINARY_URL
/usr/bin/install

推荐答案

您需要安装pip3.

在Linux上,命令为:sudo apt install python3-pip

在Mac上,使用brew,首先是brew install python3
然后brew postinstall python3

On Linux, the command would be: sudo apt install python3-pip

On Mac, using brew, first brew install python3
Then brew postinstall python3

尝试致电pip3 -V看看是否有效.

Try calling pip3 -V to see if it worked.

这篇关于pip3:找不到命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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