TensorFlow(Mac OS X)安装:URLError

时间:2016-06-29 13:13:02

标签: python macos tensorflow

OS X版本: 10.11.5(El Capitan)

TensorFlow版本: 9.0

安装pip之后,我按照TensorFlow.org中“Pip安装”下的说明继续安装TensorFlow。

export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/tensorflow-0.9.0-py2-none-any.whl

然后

sudo pip install --upgrade $TF_BINARY_URL

然而,即使我复制并粘贴了命令,我也收到了“URLError”。

  

sudo pip install --upgrade $ TF_BINARY_URL   正在下载/解压缩https://storage.googleapis.com/tensorflow/mac/tensorflow-0.9.0-py2-none-any.whl     获取https://storage.googleapis.com/tensorflow/mac/tensorflow-0.9.0-py2-none-any.whl时出错   例外:   Traceback(最近一次调用最后一次):     文件“/Users/user-name/anaconda/lib/python2.7/site-packages/pip/basecommand.py”,第139行,主要       status = self.run(options,args)     运行文件“/Users/user-name/anaconda/lib/python2.7/site-packages/pip/commands/install.py”,第266行       requirement_set.prepare_files(finder,force_root_egg_info = self.bundle,bundle = self.bundle)     在prepare_files中输入文件“/Users/user-name/anaconda/lib/python2.7/site-packages/pip/req.py”,第1033行       self.unpack_url(url,location,self.is_download)     在unpack_url中输入文件“/Users/user-name/anaconda/lib/python2.7/site-packages/pip/req.py”,第1161行       retval = unpack_http_url(link,location,self.download_cache,self.download_dir)     在unpack_http_url中输入文件“/Users/user-name/anaconda/lib/python2.7/site-packages/pip/download.py”,第534行       resp = _get_response_from_url(target_url,link)     在_get_response_from_url中输入文件“/Users/user-name/anaconda/lib/python2.7/site-packages/pip/download.py”,第569行       resp = urlopen(target_url)     在电话中输入文件“/Users/user-name/anaconda/lib/python2.7/site-packages/pip/download.py”,第143行       response = self.get_opener(scheme = scheme).open(url)     文件“/Users/user-name/anaconda/lib/python2.7/urllib2.py”,404行,打开       response = self._open(req,data)     文件“/Users/user-name/anaconda/lib/python2.7/urllib2.py”,第422行,在_open中       '_open',req)     在_call_chain中输入文件“/Users/user-name/anaconda/lib/python2.7/urllib2.py”,第382行       result = func(* args)     在https_open中输入文件“/Users/user-name/anaconda/lib/python2.7/site-packages/pip/download.py”,第123行       return self.do_open(self.specialized_conn_class,req)     在do_open中输入文件“/Users/user-name/anaconda/lib/python2.7/urllib2.py”,第1184行       提出URLError(错误)   URLError:   存储完整的日志/Users/user-name/.pip/pip.log

1 个答案:

答案 0 :(得分:0)

我在Stackoverflow中找到了这个post。接受的答案表明“urlopen错误”的原因可能是旧版本的python。将python从2.7.5更新到2.7.12之后,问题就解决了。