• 周六. 5月 3rd, 2025

ImportError: No module named keras

2月 18, 2019

安装 keras module

命令:sudo pip install –upgrade keras

Seven:HyperLPR Seven$ sudo pip install –upgrade keras
Password:
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.
The directory ‘/Users/Seven/Library/Caches/pip/http’ or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.
The directory ‘/Users/Seven/Library/Caches/pip’ or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.
Collecting keras
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘ReadTimeoutError(“HTTPSConnectionPool(host=’pypi.org’, port=443): Read timed out. (read timeout=15)”,)’: /simple/keras/
Downloading https://files.pythonhosted.org/packages/5e/10/aa32dad071ce52b5502266b5c659451cfd6ffcbf14e6c8c4f16c0ff5aaab/Keras-2.2.4-py2.py3-none-any.whl (312kB)
100% |████████████████████████████████| 317kB 4.7kB/s
Requirement already satisfied, skipping upgrade: six>=1.9.0 in /usr/local/Cellar/anaconda2/lib/python2.7/site-packages (from keras) (1.10.0)
Collecting keras-preprocessing>=1.0.5 (from keras)
Downloading https://files.pythonhosted.org/packages/c0/bf/0315ef6a9fd3fc2346e85b0ff1f5f83ca17073f2c31ac719ab2e4da0d4a3/Keras_Preprocessing-1.0.9-py2.py3-none-any.whl (59kB)
100% |████████████████████████████████| 61kB 2.9kB/s
Requirement already satisfied, skipping upgrade: numpy>=1.9.1 in /usr/local/Cellar/anaconda2/lib/python2.7/site-packages (from keras) (1.12.1)
Collecting keras-applications>=1.0.6 (from keras)
Downloading https://files.pythonhosted.org/packages/90/85/64c82949765cfb246bbdaf5aca2d55f400f792655927a017710a78445def/Keras_Applications-1.0.7-py2.py3-none-any.whl (51kB)
100% |████████████████████████████████| 61kB 3.2kB/s
Requirement already satisfied, skipping upgrade: scipy>=0.14 in /usr/local/Cellar/anaconda2/lib/python2.7/site-packages (from keras) (0.19.0)
Requirement already satisfied, skipping upgrade: pyyaml in /usr/local/Cellar/anaconda2/lib/python2.7/site-packages (from keras) (3.12)
Requirement already satisfied, skipping upgrade: h5py in /usr/local/Cellar/anaconda2/lib/python2.7/site-packages (from keras) (2.7.0)
Installing collected packages: keras-preprocessing, keras-applications, keras
Successfully installed keras-2.2.4 keras-applications-1.0.7 keras-preprocessing-1.0.9