I compiled, installed TensorFlow from the source (GitHub: https://github.com/tensorflow/tensorflow ) in a Python 2.7 virtual environment (venv). It worked fine, but I needed (as others mentioned, for example, the user "mrry" in Error starting the main tensor flow example ), so that cd from the section in which I compiled TensorFlow to another section in order to be able to import shadoworflow in Python. Otherwise, I received various errors, depending on which directory (source section) I was in. To clarify:
source: /mnt/Vancouver/apps/tensorflow can't import tf: Python launched in any of /mnt/... can import tf: Python launched in /home/victoria/...
Later I just followed the instructions here,
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/g3doc/get_started/os_setup.md
and everything just works, great.
For reference, I work on
- Arch Linux [4.6.3-1-ARCH] x86_64
- Intel i7-4790
- xfce working environment 4.12
INSTALL STEPS:
Change the paths, venv names to your preference.
Note: adding the "anaconda" meta-package installs ALL Anaconda packages (NumPy; ...).
Source activates venv (tf-env)
source activate tf-env
Note: added to ~ / .bashrc as an alias:
alias tf='echo " [TensorFlow in Anaconda Python 2.7 venv (source activate tf]" && source activate tf-env'
Install TensorFlow in tf-env venv:
(tf-env)$ conda install -c conda-forge tensorflow
THIS excludes the use of pip (including installing * .whl install script), an alternative approach to installing TensorFlow, which is described here:
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/g3doc/get_started/os_setup.md).
WORKS!
(tf-env)[victoria@victoria ~]$ P [P: python] Python 2.7.12 |Anaconda 4.1.1 (64-bit)| (default, Jul 2 2016, 17:42:40) [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2 Type "help", "copyright", "credits" or "license" for more information. Anaconda is brought to you by Continuum Analytics. Please check out: http://continuum.io/thanks and https://anaconda.org >>> import tensorflow >>> print tensorflow.__version__ 0.9.0 >>> [Ctrl-D] (tf-env)[victoria@victoria ~]$
Then you can work with TensorFlow in tf-env; for example, on Jupyter laptops running in this (tf-env) venv.