pip で “THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE.”とかの対応

備忘録。

pip で raspiのtensorflow インストールに失敗する。HASHが違うとエラー。

pi@raspberrypi:~ $ sudo pip --no-cache-dir install --upgrade tensorflow==1.9.0
Collecting tensorflow==1.9.0
  Downloading https://www.piwheels.org/simple/tensorflow/tensorflow-1.9.0-cp27-none-linux_armv6l.whl (62.8MB)
    25% |?????????                       | 16.0MB 324kB/s eta 0:02:25
THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.
    tensorflow==1.9.0 from https://www.piwheels.org/simple/tensorflow/tensorflow-1.9.0-cp27-none-linux_armv6l.whl#sha256=ca364521a1c4dc6cc2c19798bbd65d51f2c599d67cd5626f0301d05f6d8adc1b:
        Expected sha256 ca364521a1c4dc6cc2c19798bbd65d51f2c599d67cd5626f0301d05f6d8adc1b
             Got        c04d65eb504b6c6d0033210001b84f7a0e6fe88319c7ffc43b5ff6e0fa05a883

fromから wgetでダウンロードしてみたら、通信エラー。”TLS packet with unexpected length was received” サーバ過負荷か通信経路障害か。自動リトライ7回目でダウンロードできた。

wget https://www.piwheels.org/simple/tensorflow/tensorflow-1.
9.0-cp27-none-linux_armv6l.whl
--2019-06-26 02:10:52--  https://www.piwheels.org/simple/tensorflow/tensorflow-1.9.0-cp27-none-linux_armv6l.whl
Resolving www.piwheels.org (www.piwheels.org)... 93.93.129.174, 46.235.225.189
Connecting to www.piwheels.org (www.piwheels.org)|93.93.129.174|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 62793521 (60M)
Saving to: ‘tensorflow-1.9.0-cp27-none-linux_armv6l.whl’

tensorflow-1.9.0-cp  24%[===>                ]  14.61M  49.3KB/s    in 1m 49s

2019-06-26 02:12:42 (138 KB/s) - Read error at byte 15319040/62793521 (A TLS packet with unexpected length was received.). Retrying.

--2019-06-26 02:12:43--  (try: 2)  https://www.piwheels.org/simple/tensorflow/tensorflow-1.9.0-cp27-none-linux_armv6l.whl
Connecting to www.piwheels.org (www.piwheels.org)|93.93.129.174|:443... connected.
HTTP request sent, awaiting response... 206 Partial Content
Length: 62793521 (60M), 47474481 (45M) remaining
Saving to: ‘tensorflow-1.9.0-cp27-none-linux_armv6l.whl’

tensorflow-1.9.0-cp  42%[++++===>            ]  25.27M  87.2KB/s    in 48s

2019-06-26 02:13:33 (227 KB/s) - Read error at byte 26492928/62793521 (A TLS packet with unexpected length was received.). Retrying.

--2019-06-26 02:13:35--  (try: 3)  https://www.piwheels.org/simple/tensorflow/tensorflow-1.9.0-cp27-none-linux_armv6l.whl
Connecting to www.piwheels.org (www.piwheels.org)|93.93.129.174|:443... connected.
HTTP request sent, awaiting response... 206 Partial Content
Length: 62793521 (60M), 36300593 (35M) remaining
Saving to: ‘tensorflow-1.9.0-cp27-none-linux_armv6l.whl’

tensorflow-1.9.0-cp  71%[++++++++=====>      ]  42.81M   486KB/s    in 58s

2019-06-26 02:14:34 (311 KB/s) - Read error at byte 44892160/62793521 (A TLS packet with unexpected length was received.). Retrying.

--2019-06-26 02:14:37--  (try: 4)  https://www.piwheels.org/simple/tensorflow/tensorflow-1.9.0-cp27-none-linux_armv6l.whl
Connecting to www.piwheels.org (www.piwheels.org)|93.93.129.174|:443... connected.
HTTP request sent, awaiting response... 206 Partial Content
Length: 62793521 (60M), 17901361 (17M) remaining
Saving to: ‘tensorflow-1.9.0-cp27-none-linux_armv6l.whl’

tensorflow-1.9.0-cp  78%[++++++++++++++>     ]  47.05M   149KB/s    in 36s

2019-06-26 02:15:15 (119 KB/s) - Read error at byte 49332224/62793521 (A TLS packet with unexpected length was received.). Retrying.

--2019-06-26 02:15:19--  (try: 5)  https://www.piwheels.org/simple/tensorflow/tensorflow-1.9.0-cp27-none-linux_armv6l.whl
Connecting to www.piwheels.org (www.piwheels.org)|93.93.129.174|:443... connected.
HTTP request sent, awaiting response... 206 Partial Content
Length: 62793521 (60M), 13461297 (13M) remaining
Saving to: ‘tensorflow-1.9.0-cp27-none-linux_armv6l.whl’

tensorflow-1.9.0-cp  87%[+++++++++++++++=>   ]  52.50M   205KB/s    in 51s

2019-06-26 02:16:11 (110 KB/s) - Read error at byte 55050240/62793521 (A TLS packet with unexpected length was received.). Retrying.

--2019-06-26 02:16:16--  (try: 6)  https://www.piwheels.org/simple/tensorflow/tensorflow-1.9.0-cp27-none-linux_armv6l.whl
Connecting to www.piwheels.org (www.piwheels.org)|93.93.129.174|:443... connected.
HTTP request sent, awaiting response... 206 Partial Content
Length: 62793521 (60M), 7743281 (7.4M) remaining
Saving to: ‘tensorflow-1.9.0-cp27-none-linux_armv6l.whl’

tensorflow-1.9.0-cp  99%[+++++++++++++++++=> ]  59.34M   247KB/s    in 42s

2019-06-26 02:16:59 (168 KB/s) - Read error at byte 62226432/62793521 (A TLS packet with unexpected length was received.). Retrying.

--2019-06-26 02:17:05--  (try: 7)  https://www.piwheels.org/simple/tensorflow/tensorflow-1.9.0-cp27-none-linux_armv6l.whl
Connecting to www.piwheels.org (www.piwheels.org)|93.93.129.174|:443... connected.
HTTP request sent, awaiting response... 206 Partial Content
Length: 62793521 (60M), 567089 (554K) remaining
Saving to: ‘tensorflow-1.9.0-cp27-none-linux_armv6l.whl’

tensorflow-1.9.0-cp 100%[+++++++++++++++++++>]  59.88M   259KB/s    in 2.1s

2019-06-26 02:17:08 (259 KB/s) - ‘tensorflow-1.9.0-cp27-none-linux_armv6l.whl’ saved [62793521/62793521]

現在pip でインストール中。raspberry pi zero w ですでに3時間、終わる気配がない。とりあえずエラーは回避できた模様。

pi@raspberrypi:~ $ python -m pip install tensorflow-1.9.0-cp27-none-linux_armv6l.whl
 DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
 Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
 Processing ./tensorflow-1.9.0-cp27-none-linux_armv6l.whl
 Collecting protobuf>=3.4.0 (from tensorflow==1.9.0)
   Downloading https://files.pythonhosted.org/packages/8f/5a/077f2811869284d8e15fcc88818922e19cf205a3529f21210f3a1b47dc74/protobuf-3.8.0-py2.py3-none-any.whl (427kB)
      |????????????????????????????????| 430kB 670kB/s
 Collecting absl-py>=0.1.6 (from tensorflow==1.9.0)
   Downloading https://files.pythonhosted.org/packages/da/3f/9b0355080b81b15ba6a9ffcf1f5ea39e307a2778b2f2dc8694724e8abd5b/absl-py-0.7.1.tar.gz (99kB)
      |????????????????????????????????| 102kB 957kB/s
 Requirement already satisfied: six>=1.10.0 in /usr/lib/python2.7/dist-packages (from tensorflow==1.9.0) (1.12.0)
 Collecting grpcio>=1.8.6 (from tensorflow==1.9.0)
   Downloading https://files.pythonhosted.org/packages/fb/d5/30bc142a40bb891c28739ec48c99730d20e5fb9cf9637036b4b52f70505b/grpcio-1.21.1.tar.gz (13.9MB)
      |????????????????????????????????| 13.9MB 120kB/s
 Collecting termcolor>=1.1.0 (from tensorflow==1.9.0)
   Downloading https://files.pythonhosted.org/packages/8a/48/a76be51647d0eb9f10e2a4511bf3ffb8cc1e6b14e9e4fab46173aa79f981/termcolor-1.1.0.tar.gz
 Collecting gast>=0.2.0 (from tensorflow==1.9.0)
   Downloading https://files.pythonhosted.org/packages/4e/35/11749bf99b2d4e3cceb4d55ca22590b0d7c2c62b9de38ac4a4a7f4687421/gast-0.2.2.tar.gz
 Collecting tensorboard<1.10.0,>=1.9.0 (from tensorflow==1.9.0)
   Downloading https://files.pythonhosted.org/packages/d5/98/e2e9d5afbc86cef0b2dd0f4ab791519b9bd305ea207e1e5c2f9a9f2f6da6/tensorboard-1.9.0-py2-none-any.whl (3.3MB)
      |????????????????????????????????| 3.3MB 1.4MB/s
 Collecting backports.weakref>=1.0rc1 (from tensorflow==1.9.0)
   Downloading https://files.pythonhosted.org/packages/88/ec/f598b633c3d5ffe267aaada57d961c94fdfa183c5c3ebda2b6d151943db6/backports.weakref-1.0.post1-py2.py3-none-any.whl
 Collecting astor>=0.6.0 (from tensorflow==1.9.0)
   Downloading https://files.pythonhosted.org/packages/d1/4f/950dfae467b384fc96bc6469de25d832534f6b4441033c39f914efd13418/astor-0.8.0-py2.py3-none-any.whl
 Requirement already satisfied: wheel in /usr/lib/python2.7/dist-packages (from tensorflow==1.9.0) (0.29.0)
 Requirement already satisfied: setuptools<=39.1.0 in /usr/lib/python2.7/dist-packages (from tensorflow==1.9.0) (33.1.1) Collecting mock>=2.0.0 (from tensorflow==1.9.0)
   Downloading https://files.pythonhosted.org/packages/05/d2/f94e68be6b17f46d2c353564da56e6fb89ef09faeeff3313a046cb810ca9/mock-3.0.5-py2.py3-none-any.whl
 Requirement already satisfied: enum34>=1.1.6 in /usr/lib/python2.7/dist-packages (from tensorflow==1.9.0) (1.1.6)
 Collecting numpy>=1.13.3 (from tensorflow==1.9.0)
   Downloading https://files.pythonhosted.org/packages/d3/4b/f9f4b96c0b1ba43d28a5bdc4b64f0b9d3fbcf31313a51bc766942866a7c7/numpy-1.16.4.zip (5.1MB)
      |????????????????????????????????| 5.1MB 1.6MB/s
 Collecting futures>=2.2.0; python_version < "3.2" (from grpcio>=1.8.6->tensorflow==1.9.0)
   Downloading https://files.pythonhosted.org/packages/2d/99/b2c4e9d5a30f6471e410a146232b4118e697fa3ffc06d6a65efde84debd0/futures-3.2.0-py2-none-any.whl
 Collecting markdown>=2.6.8 (from tensorboard<1.10.0,>=1.9.0->tensorflow==1.9.0)
   Downloading https://files.pythonhosted.org/packages/c0/4e/fd492e91abdc2d2fcb70ef453064d980688762079397f779758e055f6575/Markdown-3.1.1-py2.py3-none-any.whl (87kB)
      |????????????????????????????????| 92kB 912kB/s
 Requirement already satisfied: werkzeug>=0.11.10 in /usr/lib/python2.7/dist-packages (from tensorboard<1.10.0,>=1.9.0->tensorflow==1.9.0) (0.11.15)
 Collecting funcsigs>=1; python_version < "3.3" (from mock>=2.0.0->tensorflow==1.9.0)
   Downloading https://files.pythonhosted.org/packages/69/cb/f5be453359271714c01b9bd06126eaf2e368f1fddfff30818754b5ac2328/funcsigs-1.0.2-py2.py3-none-any.whl
 Building wheels for collected packages: absl-py, grpcio, termcolor, gast, numpy
   Building wheel for absl-py (setup.py) … done
   Stored in directory: /home/pi/.cache/pip/wheels/ee/98/38/46cbcc5a93cfea5492d19c38562691ddb23b940176c14f7b48
   Building wheel for grpcio (setup.py) … -

備忘録2.コマンド間違えていて途中で権限なしエラー。sudo で実行するつもりがpython -m で書いていた。

sudo pip install tensorflow-1.9.0-cp27-none-linux_armv6l.whl

で途中から継続、計6時間程度で終了。

pi@raspberrypi:~ $ python
 Python 2.7.13 (default, Sep 26 2018, 18:42:22)
 [GCC 6.3.0 20170516] on linux2
 Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> hello=tf.constant("hello,shioshio")
>>> sess=tf.Session()
>>> print(sess.run(hello))
hello,shioshio         

動いた。よしよし。

コメントを残す

メールアドレスが公開されることはありません。

CAPTCHA