0
votes

I am using crestle.ai site to build some models. In the Jupyter notebook when I try to import something from keras I get :

****ModuleNotFoundError: No module named 'tensorflow'****

I found that tensorflow does not work with Python 3.7 which is pre-installed in crestle. So I tried several ways to install Python 3.5 but nothing worked

!conda install python=3.5.0 --yes

I got:

Solving environment: failed UnsatisfiableError: The following specifications were found to be in conflict: - jupyter_contrib_nbextensions -> jupyter_highlight_selected_word[version='>=0.1.1'] -> python[version='>=3.7,<3.8.0a0'] -> readline[version='>=7.0,<8.0a0'] - jupyter_contrib_nbextensions -> jupyter_highlight_selected_word[version='>=0.1.1'] -> python[version='>=3.7,<3.8.0a0'] -> tk[version='>=8.6.8,<8.7.0a0'] - jupyter_contrib_nbextensions -> jupyter_highlight_selected_word[version='>=0.1.1'] -> python[version='>=3.7,<3.8.0a0'] -> xz[version='>=5.2.4,<6.0a0'] - python=3.5.0 Use "conda info " to see the dependencies for each package.

!pip3 install --upgrade tensorflow-gpu

I got

Collecting tensorflow-gpu Could not find a version that satisfies the requirement tensorflow-gpu (from versions: ) No matching distribution found for tensorflow-gpu

!pip install --upgrade tensorflow

I got:

Collecting tensorflow Could not find a version that satisfies the requirement tensorflow (from versions: ) No matching distribution found for tensorflow

I am following suggestions from different blogs and don't know what I am doing or if I am doing it right.

As per Anand's suggestion

!conda env list ​ **# conda environments: # base /home/nbuser/.anaconda3

new_environment /home/nbuser/.anaconda3/envs/new_environment

py36 /home/nbuser/.anaconda3/envs/py36

tensorflow /home/nbuser/.anaconda3/envs/tensorflow**

!source activate py36

/bin/sh: 1: source: not found

Do I need some path command?

Edit: !activate py36 I got no output!

!pip3 install --upgrade tensorflow Collecting tensorflow Could not find a version that satisfies the requirement tensorflow (from versions: ) No matching distribution found for tensorflow

enter image description here

enter image description here

Edit: Thanks. I was not aware of the terminal and was doing it wrong! This is what I got after $pip install tensorflow-gpu

after pip command

What do I need to do next? I tried in Jupyter importing modules from keras but again I got:

Using TensorFlow backend.

ModuleNotFoundError Traceback (most recent call last) in () ----> 1 from keras.models import Sequential

I also tried to use keras on crestle.com instead (previous was crestle.ai). I got this: keras on crestle.com

It shows python 3.6 but the similar issue..

1

1 Answers

0
votes

python[version='>=3.7,<3.8.0a0'] This is part of your error, this basically means that you are still unable to get out of using Python3.7, hence the no module found error, I would suggest you to make a new environment in conda using.

conda create --name py36 python=3.6

In your conda prompt, then activate this environment by using

After that use conda env list and you should see an Enviornment named py36.

Activate this environment by using source activate py36

Edit If you are using conda prompt not terminal, directly use activate py36

Then try pip commands again, once the environment is activated.

If it still fails, let me know and we will see what the problem might be.

Edit You have to use this commands in the terminal that comes with crestle and not in its's Jupyter notebook.

The terminal can be accessed from the top right, you can see the New_>Terminal Button. And if it says conda is not installed, you might follow this link. https://www.digitalocean.com/community/tutorials/how-to-install-the-anaconda-python-distribution-on-ubuntu-16-04

Image with Terminal running in crestle