简体   繁体   中英

TensorFlow (Mac OS X) installation: URLError

OS X version: 10.11.5 (El Capitan)

TensorFlow version: 9.0

After installing pip, I proceeded to install TensorFlow following the instructions under "Pip installation" from TensorFlow.org .

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

then

sudo pip install --upgrade $TF_BINARY_URL

However, even though I copied and pasted the command, I received "URLError".

sudo pip install --upgrade $TF_BINARY_URL Downloading/unpacking https://storage.googleapis.com/tensorflow/mac/tensorflow-0.9.0-py2-none-any.whl Error while getting https://storage.googleapis.com/tensorflow/mac/tensorflow-0.9.0-py2-none-any.whl Exception: Traceback (most recent call last): File "/Users/user-name/anaconda/lib/python2.7/site-packages/pip/basecommand.py", line 139, in main status = self.run(options, args) File "/Users/user-name/anaconda/lib/python2.7/site-packages/pip/commands/install.py", line 266, in run requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle) File "/Users/user-name/anaconda/lib/python2.7/site-packages/pip/req.py", line 1033, in prepare_files self.unpack_url(url, location, self.is_download) File "/Users/user-name/anaconda/lib/python2.7/site-packages/pip/req.py", line 1161, in unpack_url retval = unpack_http_url(link, location, self.download_cache, self.download_dir) File "/Users/user-name/anaconda/lib/python2.7/site-pack ages/pip/download.py", line 534, in unpack_http_url resp = _get_response_from_url(target_url, link) File "/Users/user-name/anaconda/lib/python2.7/site-packages/pip/download.py", line 569, in _get_response_from_url resp = urlopen(target_url) File "/Users/user-name/anaconda/lib/python2.7/site-packages/pip/download.py", line 143, in call response = self.get_opener(scheme=scheme).open(url) File "/Users/user-name/anaconda/lib/python2.7/urllib2.py", line 404, in open response = self._open(req, data) File "/Users/user-name/anaconda/lib/python2.7/urllib2.py", line 422, in _open '_open', req) File "/Users/user-name/anaconda/lib/python2.7/urllib2.py", line 382, in _call_chain result = func(*args) File "/Users/user-name/anaconda/lib/python2.7/site-packages/pip/download.py", line 123, in https_open return self.do_open(self.specialized_conn_class, req) File "/Users/user-name/anaconda/lib/python2.7/urllib2.py", line 1184, in do_open raise URLError(err) URLError: Storing complete log in /Users/user-n ame/.pip/pip.log

I found this post from Stackoverflow. The accepted answer suggested the cause of "urlopen error" may be the older version of python. After updating python from 2.7.5 to 2.7.12, the problem is solved.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM