3

I have installed Ubuntu Desktop 16.04 on a supercomputer and it uses for multiple-user using. Let's the name as the suppercomputer is a serverubuntu. In the serverubuntu, I have install tensorflow-gpu 1.2 as

serverubuntu$serverubuntu sudo pip install tensorflow-gpu==1.2

After done, I can import the tensorflow when I am typing in the server

serverubuntu$serverubuntu python
>>> import tensorflow as tf
>>>

Right now, I will add a new user that will remote the server using ssh. Let's call it is user1. The user1 will access the server based on ssh as

ssh user1@ip-server
user1@serverubuntu

I will try to use tensorflow from terminal of user1 as

user1@serverubuntu python
>>> import tensorflow as tf
ImportError: No module named tensorflow

However, I got the above error. It is not installed not install tensorflow for user1, although user1 are remoting/using on the server. I tried to go to the server and do the import tensorflow as tf in the terminal of server and it works. How could I use tensorflow if I am in the terminal of user1?

  • In serverubuntu$serverubuntu python, after importing tensorflow do: >>> tf.__file__ ; to see where exactly is the package installed. In user1@serverubuntu python, do: >>> import sys >>> print '\n'.join(sys.path) ; Check if path of tensorflow package is included in 'sys.path' of user1 If not, do: >>> sys.path.append('<tensorflow_package_path>') – mdilip May 24 '18 at 16:21

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.