If your virtual environment is in python3. Running an application to install fiforflow should install it in a python3 environment.
$ virtualenv3 venv $ source venv/bin/activate (venv)$ pip install tensorflow (venv)$ pip freeze appdirs==1.4.3 numpy==1.12.1 packaging==16.8 protobuf==3.3.0 pyparsing==2.2.0 six==1.10.0 tensorflow==1.1.0 Werkzeug==0.12.2 (venv) $>python Python 3.6.0 (default, Jan 16 2017, 12:12:55) [GCC 6.3.1 20170109] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import tensorflow as tf >>>
If you use
virtualenv ~/.tensorflow/bin/activate
make sure virtualenv for python3. And your virtual env will be created in ~/.tensorflow/bin/activate (not sure if you want this). I would suggest changing this address to something simple and make sure that it does not contain a folder named as some of the libraries that you want to import. Sometimes this causes problems.
If you are trying to import tf into ipython3, you must also ensure that ipython is installed in the same environment. And if you run
ipython notebook
This will start ipython by default (/ usr / bin / ipython). You donโt want it. So run venv/bin/ipython3 instead
source share