I'm trying to setup keras
deep learning library for Python3.5
on Ubuntu 16.04 LTS and use Tensorflow
as a backend. I have Python2.7
and Python3.5
installed. I have installed Anaconda
and with help of it Tensorflow
, numpy
, scipy
, pyyaml
. Afterwards I have installed keras
with command
sudo python setup.py install
Although I can see /usr/local/lib/python3.5/dist-packages/Keras-1.1.0-py3.5.egg
directory, I cannot use keras
library. When I try to import it in python it says
ImportError: No module named 'keras'
I have tried to install keras
usingpip3
, but got the same result.
What am I doing wrong? Any Ideas?
This question is related to
python
ubuntu
tensorflow
anaconda
keras
Firstly checked the list of installed Python packages by:
pip list | grep -i keras
If there is keras shown then install it by:
pip install keras --upgrade --log ./pip-keras.log
now check the log, if there is any pending dependencies are present, it will affect your installation. So remove dependencies and then again install it.
Ran to the same issue, Assuming your using anaconda3 and your using a venv
with >= python=3.6
:
python -m pip install keras
sudo python -m pip install --user tensorflow
I had pip
referring by default to pip3, which made me download the libs for python3. On the contrary I launched the shell as python
(which opened python 2) and the library wasn't installed there obviously.
Once I matched the names pip3 -> python3, pip -> python (2) all worked.
Source: Stackoverflow.com