我想按照这些说明安装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
如何获取pip3? 我的操作系统是macOS High Sierra,我已经安装了Python 3.6.2。
编辑:我尝试过
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命令,但是我不确定它是否起作用了...
MakotonoMacBook-ea:~ makotomiyazaki$ sudo which pip3 install --upgrade $TF_BINARY_URL
/usr/bin/install
python3 -m pip
能用吗?不过你应该无论如何都要安装到虚拟环境中。 - Ry-which pip3
吗?我安装了python2和python3,因为我太懒得设置别名,所以我必须使用完整路径。 - dstudeba