環(huán)境
操作系統(tǒng):macOS Big Sur
Python版本:3.9
Tensorflow安裝
#更新pip
$ pip install —upgrade pip
pip安裝tensorflow
$ pip install tensorflow
注意!!下面這個(gè)不要安裝坑填,安裝了會(huì)出錯(cuò)的
$ pip install tf-nightly
如果報(bào)錯(cuò)了抛人,卸載重新安裝
pip uninstall tf-nightly
pip uninstall tensorflow
如果碰到
ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.
更進(jìn)一步 更改源
進(jìn)入根目錄:cd ~/
進(jìn)入.pip目錄 cd .pip
如果不存在文件夾就新建mkdir .pip
進(jìn)入 cd .pip
創(chuàng)建pip.conf文件 touch pip.conf
修改:vim pip.conf
[global]
timeout = 60
index-url = [https://pypi.doubanio.com/simple](https://pypi.doubanio.com/simple)