【发布时间】:2018-06-09 10:22:10
【问题描述】:
我想按照此说明安装 Tensorflow。 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 并尝试卸载并重新安装 pip-3,但没有成功。
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有效吗?不过,无论如何,您都应该将软件包安装到 venv 中。 -
你试过
which pip3吗?我同时安装了 python2 和 python3,由于我懒得设置别名,我将不得不做整个路径。 -
感谢您的 cmets,我都尝试了,但似乎没有成功...
标签: python tensorflow homebrew pip3