在Mac下安装TensorFlow出错

在Mac下安装TensorFlow出错

(tensorflow)  alfred@Alfred  pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.12.0-py2-none-any.whl
Collecting tensorflow==1.12.0 from https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.12.0-py2-none-any.whl
  Downloading https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.12.0-py2-none-any.whl (62.0MB)
    2% |█                               | 1.8MB 16kB/s eta 0:59:58Exception:
Traceback (most recent call last):
  File "/Users/alfred.pz/anaconda3/envs/tensorflow/lib/python2.7/site-packages/pip/_internal/cli/base_command.py", line 143, in main
    status = self.run(options, args)
  File "/Users/alfred.pz/anaconda3/envs/tensorflow/lib/python2.7/site-packages/pip/_internal/commands/install.py", line 318, in run
    resolver.resolve(requirement_set)
  File "/Users/alfred.pz/anaconda3/envs/tensorflow/lib/python2.7/site-packages/pip/_internal/resolve.py", line 102, in resolve
    self._resolve_one(requirement_set, req)
  File "/Users/alfred.pz/anaconda3/envs/tensorflow/lib/python2.7/site-packages/pip/_internal/resolve.py", line 256, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/Users/alfred.pz/anaconda3/envs/tensorflow/lib/python2.7/site-packages/pip/_internal/resolve.py", line 209, in _get_abstract_dist_for
    self.require_hashes
  File "/Users/alfred.pz/anaconda3/envs/tensorflow/lib/python2.7/site-packages/pip/_internal/operations/prepare.py", line 283, in prepare_linked_requirement
    progress_bar=self.progress_bar
  File "/Users/alfred.pz/anaconda3/envs/tensorflow/lib/python2.7/site-packages/pip/_internal/download.py", line 836, in unpack_url
    progress_bar=progress_bar
  File "/Users/alfred.pz/anaconda3/envs/tensorflow/lib/python2.7/site-packages/pip/_internal/download.py", line 673, in unpack_http_url
    progress_bar)
  File "/Users/alfred.pz/anaconda3/envs/tensorflow/lib/python2.7/site-packages/pip/_internal/download.py", line 897, in _download_http_url
    _download_url(resp, link, content_file, hashes, progress_bar)
  File "/Users/alfred.pz/anaconda3/envs/tensorflow/lib/python2.7/site-packages/pip/_internal/download.py", line 619, in _download_url
    consume(downloaded_chunks)
  File "/Users/alfred.pz/anaconda3/envs/tensorflow/lib/python2.7/site-packages/pip/_internal/utils/misc.py", line 848, in consume
    deque(iterator, maxlen=0)
  File "/Users/alfred.pz/anaconda3/envs/tensorflow/lib/python2.7/site-packages/pip/_internal/download.py", line 585, in written_chunks
    for chunk in chunks:
  File "/Users/alfred.pz/anaconda3/envs/tensorflow/lib/python2.7/site-packages/pip/_internal/utils/ui.py", line 159, in iter
    for x in it:
  File "/Users/alfred.pz/anaconda3/envs/tensorflow/lib/python2.7/site-packages/pip/_internal/download.py", line 574, in resp_read
    decode_content=False):
  File "/Users/alfred.pz/anaconda3/envs/tensorflow/lib/python2.7/site-packages/pip/_vendor/urllib3/response.py", line 465, in stream
    data = self.read(amt=amt, decode_content=decode_content)
  File "/Users/alfred.pz/anaconda3/envs/tensorflow/lib/python2.7/site-packages/pip/_vendor/urllib3/response.py", line 430, in read
    raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
  File "/Users/alfred.pz/anaconda3/envs/tensorflow/lib/python2.7/contextlib.py", line 35, in __exit__
    self.gen.throw(type, value, traceback)
  File "/Users/alfred.pz/anaconda3/envs/tensorflow/lib/python2.7/site-packages/pip/_vendor/urllib3/response.py", line 345, in _error_catcher
    raise ReadTimeoutError(self._pool, None, 'Read timed out.')
ReadTimeoutError: HTTPSConnectionPool(host='storage.googleapis.com', port=443): Read timed out.
(tensorflow)  alfred@Alfred  pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.12.0-py2-none-any.whl

直接在linux下通过wget 获取下载

[root@local ~]# wget https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.12.0-py2-none-any.whl
--2018-11-17 14:01:44--  https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.12.0-py2-none-any.whl
Resolving storage.googleapis.com (storage.googleapis.com)... 172.217.161.144, 2404:6800:4005:801::2010
Connecting to storage.googleapis.com (storage.googleapis.com)|172.217.161.144|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 62030841 (59M) [application/octet-stream]
Saving to: ‘tensorflow-1.12.0-py2-none-any.whl’

100%[==============================================================================================================>] 62,030,841  1003KB/s   in 2m 56s 

2018-11-17 14:04:46 (343 KB/s) - ‘tensorflow-1.12.0-py2-none-any.whl’ saved [62030841/62030841]

[root@ local ~]# ll
-rw-r--r--  1 root root 62030841 Nov  6 08:47 tensorflow-1.12.0-py2-none-any.whl

然后通过httpd服务

然后在次在mac下执行命令

pip install --ignore-installed --upgrade http://10.88.88.122/soft/tensorflow-1.12.0-py2-none-any.whl


安装完成!!!

在安装过程中还是有异常

 Downloading https://files.pythonhosted.org/packages/b5/61/c12d3d8abc719efbea9f87d92f3d70ecf30b366ec34f7a5d8f6725d98146/grpcio-1.16.1-cp27-cp27m-macosx_10_12_x86_64.whl (1.7MB)
    67% |█████████████████████▌          | 1.2MB 17kB/s eta 0:00:34Exception:
Traceback (most recent call last):

.....


File "/Users/alfred.pz/anaconda3/envs/tensorflow/lib/python2.7/contextlib.py", line 35, in __exit__
    self.gen.throw(type, value, traceback)
  File "/Users/alfred.pz/anaconda3/envs/tensorflow/lib/python2.7/site-packages/pip/_vendor/urllib3/response.py", line 345, in _error_catcher
    raise ReadTimeoutError(self._pool, None, 'Read timed out.')
ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

直接拷贝下载链接,在linux上通过wget下载,然后通过httpd在mac上执行

pip install --ignore-installed --upgrade http://10.88.88.122/soft/grpcio-1.16.1-cp27-cp27m-macosx_10_12_x86_64.whl

(tensorflow)  alfred@Alfred  pip install --ignore-installed --upgrade http://10.88.88.122/soft/grpcio-1.16.1-cp27-cp27m-macosx_10_12_x86_64.whl
Collecting grpcio==1.16.1 from http://10.88.88.122/soft/grpcio-1.16.1-cp27-cp27m-macosx_10_12_x86_64.whl
  Downloading http://10.88.88.122/soft/grpcio-1.16.1-cp27-cp27m-macosx_10_12_x86_64.whl (1.7MB)
    100% |████████████████████████████████| 1.7MB 11.5MB/s
Collecting six>=1.5.2 (from grpcio==1.16.1)
  Using cached https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Collecting futures>=2.2.0 (from grpcio==1.16.1)
  Downloading https://files.pythonhosted.org/packages/2d/99/b2c4e9d5a30f6471e410a146232b4118e697fa3ffc06d6a65efde84debd0/futures-3.2.0-py2-none-any.whl
Collecting enum34>=1.0.4 (from grpcio==1.16.1)
  Using cached https://files.pythonhosted.org/packages/c5/db/e56e6b4bbac7c4a06de1c50de6fe1ef3810018ae11732a50f15f62c7d050/enum34-1.1.6-py2-none-any.whl
Installing collected packages: six, futures, enum34, grpcio
Successfully installed enum34-1.1.6 futures-3.2.0 grpcio-1.16.1 six-1.11.0
(tensorflow)  alfred@Alfred 

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 213,417评论 6 492
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 90,921评论 3 387
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 158,850评论 0 349
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 56,945评论 1 285
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 66,069评论 6 385
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 50,188评论 1 291
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 39,239评论 3 412
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 37,994评论 0 268
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 44,409评论 1 304
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 36,735评论 2 327
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 38,898评论 1 341
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 34,578评论 4 336
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 40,205评论 3 317
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 30,916评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,156评论 1 267
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 46,722评论 2 363
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 43,781评论 2 351

推荐阅读更多精彩内容