我在为 python 3.6 安装 keras 库时遇到问题,每当我尝试安装 keras 时,它都会抛出一个错误,当在互联网上搜索时,keras 已经发布到 python 3.5,有人有解决方案吗?
follow this method if you have anaconda and python version 3.6
first Create a new conda environment
conda create -n keras python=3.5
Now activate it:
source activate keras
and install keras:
conda install keras
test if it works
$ python
>>>import keras
you will get the following message if sucessfull
Using TensorFlow backend.
I used sudo pip install keras
to download.
I have both python 2.7 and 3.6 installed on my Mac. I used pip -V
to check my python version of installation. Probably you used invalid version of python to download.
Screenshot of the install being done on my computer:
Follow the below steps , Tensorflow dosnt support py3.7 as of now , so 3.6 is better ,
I recommend using environment , (venv , conda(preferred) ),
For conda
conda create -n keras python=3.6
source activate keras
conda install tensorflow keras
#for faster installation
pip install keras
For virtualenv
virtualenv -p python3 keras
source keras/bin/activate
pip install keras tensorflow numpy
Try the following at a command prompt:
pip install --upgrade tensorflow
pip install --upgrade keras
Also, refer the following link for more detail:
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.