我想按照以下说明安装TensorFlow:https://web.archive.org/web/20170627102751/https://www.tensorflow.org/versions/r0.12/get_started/os_setup#pip_installation
但是当我在终端上尝试这段代码时,它返回一个错误。
$ sudo pip3 install --upgrade $TF_BINARY_URL
sudo: pip3: command not found
所以我安装了Homebrew,并试图卸载和重新安装python3-pip,但没有工作。
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
我的操作系统是macOS High Sierra,我已经安装了Python 3.6.2。
曲名:I Try
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")
我也试过pip 3,但只是我不知道它是否工作...
MakotonoMacBook-ea:~ makotomiyazaki$ sudo which pip3 install --upgrade $TF_BINARY_URL
/usr/bin/install
7条答案
按热度按时间6kkfgxo01#
你需要安装pip3。
在Linux上,首先运行
sudo apt update
。然后命令为:sudo apt install python3-pip
在Mac上,使用brew,首先
brew install python3
然后
brew postinstall python3
试着调用
pip3 -V
来看看它是否工作。kninwzqo2#
我有这个问题,我修复了它使用以下步骤您需要使用完全卸载python3-pip:
然后重新安装 Package :
要确认一切正常,请运行:
在此之后,您现在可以使用pip 3来管理您感兴趣的任何python包。
kse8i1jr3#
写入整个路径/目录例如(对于windows)
C:\Programs\Python\Python36-32\Scripts\pip3.exe install mypackage
。当我遇到pip问题时,这对我很有效。93ze6v8z4#
如果你已经安装了python(pip),你可以在mac上通过
vbopmzt15#
如果其他方法不起作用,请尝试以下操作:
tjjdgumg6#
在我的例子中,虽然已经安装了python3-pip,但它不能识别pip 3。
sudo yum reinstall python3-pip
它工作得很好,并识别pip 3命令。
gkl3eglg7#
在
yum install python3-pip
之后,检查安装的二进制文件的名称。在我的CentOS 7上,它被命名为
pip-3
而不是pip3
。