Problems installing tensorflow: ImportError: no module named tensorflow

: Ubuntu 14.04 (64 bit) Python2.7.11

Firstly, I installed shadoworflow in the installation path of Virtualenz.

$ sudo apt-get install python-pip python-dev python-virtualenv $ virtualenv --system-site-packages ~/tensorflow $ source ~/tensorflow/bin/activate $export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.12.1-cp27-none-linux_x86_64.whl $ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-0.12.1-cp27-none-linux_x86_64.whl $ pip install --upgrade $TF_BINARY_URL 

and then, I test my installation and a problem appears. I know that I have not installed the tensor. import of tensor flow Traceback (last last call): File "", line 1, in ImportError: No module named tensorflow

import tensor stream as tf Traceback (last last call): File "", line 1, in ImportError: No module named tensorflow

I do not know how to solve the problem. Please help me, it cost me one day. I tried removing shadoworflow and then I installed the pip installation method. But I get the same error. Protokbuf - 3.1.0.

+4
source share
3 answers

Do you run python in the same virtual environment in which you installed shadoworflow?

To access your tensorflow installation, you must first "activate" virtualenv on any new terminals, as shown below:

 source ~/tensorflow/bin/activate python import tensorflow as tf 

If you run the above in a new terminal, does your problem solve?

+5
source

When did you do this $ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-0.12.1-cp27-none-linux_x86_64.whl

In this step, you indicate that you intend to use the Nvidia card. To start the tensor stream with a graphics adapter (Nvidia graphics card) you need to fulfill all the requirements of Nvidia

Nvidia requires special privileges for its CUDA cores

You also need to check the Cuda paths for the LD_LIBRARY_PATH environment variable, check the Nvidia Documentation . You also need to install profiling support, this can be done by the libcupti-dev library, which is the interface for the NVIDIA CUDA interface. This library provides advanced profiling support. To install this library, run the following command: sudo apt-get install libcupti-dev

But if you want to start the tensor stream only in CPU mode, do not specify $ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-0.12.1-cp27-none-linux_x86_64.whl . With this, you override the TF_BINARY_URL variable to use the Nvidia CUDA kernel. So, to use the processor from all your steps, remove $ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-0.12.1-cp27-none-linux_x86_64.whl and enable only $export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.12.1-cp27-none-linux_x86_64.whl and reinstall

I hope this should fix the problem.

0
source

If your required python packages are not installed properly, check out a few things.

 $ source $HOME/tensorflow/bin/activate $ which python $ which pip 

check these binaries on the path $HOME/tensorflow/bin/activate . If yes, try

 $ pip install -I --upgrade $TF_BINARY_URL 

where the -I option forces packages to be installed.

0
source

Source: https://habr.com/ru/post/1264235/


All Articles