Ask coding questions

← Back to all posts
Isssue with import tensorflow
reykjavik11

I am trying to run script with this libraries:
import cvlib as cv
import sys
import cv2
import os

#another code

but I got a error:
Using TensorFlow backend.
Traceback (most recent call last):
File "main.py", line 1, in <module>
import cvlib as cv
File "/home/runner/.local/share/virtualenvs/python3/lib/python3.7/site-packages/cvlib/init.py", line 8, in <module>
from .gender_detection import detect_gender
File "/home/runner/.local/share/virtualenvs/python3/lib/python3.7/site-packages/cvlib/gender_detection.py", line 3, in <module>
from keras.utils import get_file
File "/home/runner/.local/share/virtualenvs/python3/lib/python3.7/site-packages/keras/init.py", line 3, in <module>
from . import utils
File "/home/runner/.local/share/virtualenvs/python3/lib/python3.7/site-packages/keras/utils/init.py", line 6, in <module>
from . import conv_utils
File "/home/runner/.local/share/virtualenvs/python3/lib/python3.7/site-packages/keras/utils/conv_utils.py", line 9, in <module>
from .. import backend as K
File "/home/runner/.local/share/virtualenvs/python3/lib/python3.7/site-packages/keras/backend/init.py", line 1, in <module>
from .load_backend import epsilon
File "/home/runner/.local/share/virtualenvs/python3/lib/python3.7/site-packages/keras/backend/load_backend.py", line 90, in <module>
from .tensorflow_backend import *
File "/home/runner/.local/share/virtualenvs/python3/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py", line 5, in <module>
import tensorflow as tf
ModuleNotFoundError: No module named 'tensorflow'

Any idea?
Thanks in advance.

Answered by Vandesm14 [earned 5 cycles]
View Answer
Voters
reykjavik11
Comments
hotnewtop
Vandesm14

Tensorflow does not work on repl.it. I suggest you post a suggestion to https://repl.it/feedback regarding the tensorflow support.

cookeydev
reykjavik11

When I try to add 'tensorflow' packages I also get another exception:

AdCharity

@reykjavik11 uh read what he said

reykjavik11

I switched to python 2.7 version.
Now it works!

AdCharity

@reykjavik11 glad you got it to work. I suggest to mark @Vandesm14's answer correct because he offered the most help (although I'll gladly take anything lmao).

Vandesm14

@AdCharity Imma switch the answer myself.