赞
踩
通过windows+R按键组合,进入cmd终端,按以下命令操作即可。
C:\Users\zgd>pip install keras
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x0000010B93ED30D0>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/keras/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x0000010B93EC6E20>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/keras/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x0000010B93EC6BE0>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/keras/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x0000010B93EC6BB0>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/keras/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x0000010B93EC6A00>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/keras/
Collecting keras
Downloading keras-2.9.0-py2.py3-none-any.whl (1.6 MB)
|████████████████████████████████| 1.6 MB 1.1 MB/s
Installing collected packages: keras
Successfully installed keras-2.9.0
C:\Users\zgd>python --version
Python 3.8.5
安装完之后,运行程序,
from keras.datasets import imdb
(train_data, train_labels), (test_data, test_labels) = imdb.load_data(num_words=10000)
ModuleNotFoundError: No module named 'tensorflow'
C:\Users\54867>pip install tensorflow
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000001CE290EE100>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/tensorflow/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000001CE290E4F10>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/tensorflow/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000001CE290E4D30>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/tensorflow/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000001CE290E4BE0>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/tensorflow/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000001CE290E48E0>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/tensorflow/
ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)
ERROR: No matching distribution found for tensorflow
只是末尾提示
查看pip list
没有找到tensorflow,意味着安装失败。
提示安装成功:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。