问题
When I import tensorflow in Python 3.5.3, it gives me following:
ERROR:
No module named _pywrap_tensorflow
Unless you are using bazel, you should not try to import tensorflow from its source directory; please exit the tensorflow source tree, and relaunch your python interpreter from there.
I installed tensorflow-0.12.0 using the following command:
python -m pip install --upgrade
https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.0-py3-none-any.whl
回答1:
Make sure that Python 3.5.3 is supported for Tensorflow, then install Microsoft Visual C++ 2015 Redistributable and try this command (note that you also need to uninstall the current Tensorflow first):
python -m pip install --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-0.12.1-cp35-cp35m-win_amd64.whl
Update: Go to https://pypi.python.org/pypi/tensorflow to check for available built that works for you.
来源:https://stackoverflow.com/questions/49610858/importing-issue-with-tensorflow-in-python-3-5-3