Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No module named "tensorflow" #60

Open
noobmaster29 opened this issue Nov 26, 2018 · 6 comments
Open

No module named "tensorflow" #60

noobmaster29 opened this issue Nov 26, 2018 · 6 comments

Comments

@noobmaster29
Copy link

noobmaster29 commented Nov 26, 2018

I followed the installation process on this page (https://spinningup.openai.com/en/latest/user/installation.html). After I run pythonw -m spinup.run plot data/installtest/installtest_s0, I am getting the following error message. I'm working in a conda environment.

Traceback (most recent call last):
File "/anaconda3/lib/python3.6/runpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/anaconda3/lib/python3.6/runpy.py", line 109, in _get_module_details
import(pkg_name)
File "/Users/tf/Documents/reinforcement_learning/spinningup/spinup/init.py", line 2, in
from spinup.algos.ddpg.ddpg import ddpg
File "/Users/tf/Documents/reinforcement_learning/spinningup/spinup/algos/ddpg/ddpg.py", line 2, in
import tensorflow as tf
ModuleNotFoundError: No module named 'tensorflow'

Any idea why tensorflow is not available? I also tried a conda install and the same error. The other testing commands seem to run ok.

@noobmaster29
Copy link
Author

I cannot run python -m spinup.run plot data/installtest/installtest_s0.

It returns this error message:

ImportError: Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not installed as a framework. See the Python documentation for more information on installing Python as a framework on Mac OS X. Please either reinstall Python as a framework, or try one of the other backends. If you are using (Ana)Conda please install python.app and replace the use of 'python' with 'pythonw'. See 'Working with Matplotlib on OSX' in the Matplotlib FAQ for more information.

@machinaut
Copy link

@noobmaster29 have you installed tensorflow? Installing tensorflow is part of the required setup.

@noobmaster29
Copy link
Author

Yes, I have Tensorflow installed as well as Keras.

@HareshKarnan
Copy link

HareshKarnan commented Dec 4, 2018

maybe you are running python2.7 instead of python3. You can make an alias for python3 using
alias python=python3

and then run your script.

@tqa236
Copy link

tqa236 commented Mar 1, 2019

I have the same problem, then I uninstall tensorflow by pip uninstall tensorflow and reinstall it using conda: conda install tensorflow, everything works fine.

I think pip is not a good choice for installing packages inside virtual environment.

@nealmcb
Copy link

nealmcb commented Apr 17, 2019

I also had the same problem. In my case, just re-running the pip install -e . step fixed it. Things worked better after I upgraded pip from version 9 to version 19 (pip install -U pip).
This is all in a Python 3 venv, which I prefer to conda.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants