streamlit / streamlit

Streamlit — A faster way to build and share data apps.
https://streamlit.io
Apache License 2.0
33.24k stars 2.9k forks source link

Streamlit unable to import tensorflow #1465

Closed shubham-seth closed 4 years ago

shubham-seth commented 4 years ago

ModuleNotFoundError: No module named 'tensorflow' Traceback:

File "/home/ubuntu/.local/lib/python3.6/site-packages/streamlit/ScriptRunner.py", line 322, in _run_script exec(code, module.dict) File "/home/ubuntu/Sumit/Sumit/creating_UI.py", line 5, in import tensorflow as tf

I am working on an aws machine with a tensorflow environment. Tensorflow ideally works fine.

jrhone commented 4 years ago

Hi @shubham-seth ,

Can you verify that you can import tensorflow without Streamlit?

jrhone commented 4 years ago

No response from user

youjin-c commented 3 years ago

Hello,

I have the same error, I can import TensorFlow in a regular python app in the same directory and under the same virtualenv and the but it cannot when I run streamlit server.

ModuleNotFoundError: No module named 'tensorflow'
Traceback:
File "/opt/anaconda3/lib/python3.7/site-packages/streamlit/script_runner.py", line 332, in _run_script
    exec(code, module.__dict__)
File "/Users/EUGENE/Documents/ADAS/webapp/demo-face-gan/streamlit_app.py", line 6, in <module>
    import tensorflow as tf