0

I'm trying to install tensorflow on a cluster (I have no sudo rights). If I try to use pip I first set the environment variable:

export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl

and then I execute:

pip install --upgrade $TF_BINARY_URL -b=/home/js668623/tools/tensorflow

The output is:

You are using pip version 7.1.0, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting tensorflow==0.9.0 from https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl
Using cached https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl
Collecting six>=1.10.0 (from tensorflow==0.9.0)
Using cached six-1.10.0-py2.py3-none-any.whl
Collecting protobuf==3.0.0b2 (from tensorflow==0.9.0)
Using cached protobuf-3.0.0b2-py2.py3-none-any.whl
Collecting wheel (from tensorflow==0.9.0)
Using cached wheel-0.29.0-py2.py3-none-any.whl
Collecting numpy>=1.8.2 (from tensorflow==0.9.0)
Using cached numpy-1.11.1.zip
Collecting setuptools (from protobuf==3.0.0b2->tensorflow==0.9.0)
Using cached setuptools-23.1.0-py2.py3-none-any.whl
Installing collected packages: six, setuptools, protobuf, wheel, numpy, tensorflow
Found existing installation: six 1.9.0
Uninstalling six-1.9.0:
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/pip/basecommand.py", line 223, in main
status = self.run(options, args)
File "/usr/lib/python2.7/site-packages/pip/commands/install.py", line 308, in run
strip_file_prefix=options.strip_file_prefix,
File "/usr/lib/python2.7/site-packages/pip/req/req_set.py", line 640, in install
requirement.uninstall(auto_confirm=True)
File "/usr/lib/python2.7/site-packages/pip/req/req_install.py", line 726, in uninstall
paths_to_remove.remove(auto_confirm)
File "/usr/lib/python2.7/site-packages/pip/req/req_uninstall.py", line 125, in remove
renames(path, new_path)
File "/usr/lib/python2.7/site-packages/pip/utils/__init__.py", line 314, in renames
shutil.move(old, new)
File "/usr/lib64/python2.7/shutil.py", line 299, in move
rmtree(src)
File "/usr/lib64/python2.7/shutil.py", line 252, in rmtree
onerror(os.remove, fullname, sys.exc_info())
File "/usr/lib64/python2.7/shutil.py", line 250, in rmtree
os.remove(fullname)
OSError: [Errno 13] Permission denied: '/usr/lib/python2.7/site-packages/six-1.9.0-py2.7.egg-info/PKG-INFO'
jojo123456
  • 341
  • 1
  • 3
  • 11

2 Answers2

2

If you don't have sudo rights on the machine, personally I find the "virtualenv" installation easiest. It should just work without root access.

https://www.tensorflow.org/versions/r0.9/get_started/os_setup.html#virtualenv-installation

You might also look into the "anaconda" installation, but I have no experience with that.

Peter Hawkins
  • 3,201
  • 19
  • 17
  • Not necessarily, see this answer for more details. http://stackoverflow.com/questions/9348869/how-to-install-virtualenv-without-using-sudo – Peter Hawkins Jun 30 '16 at 16:48
1

If you also need a specific version of python, you 'll need more than the script I give you, but with a little bit of diggig, that script should work for you ;)

module load Python/2.7.11-foss-2016a
curl -O https://bootstrap.pypa.io/get-pip.py
python get-pip.py --user --upgrade
rm get-pip.py
.local/bin/pip install --user --upgrade pip

git clone https://github.com/tensorflow/tensorflow
git clone https://github.com/bazelbuild/bazel.git
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u92-b14/jdk-8u92-linux-x64.tar.gz
tar -xf jdk*
rm jdk*.gz
cd bazel
export JAVA_HOME=~/jdk1.8.0_92/
module unload GCC/4.9.3-2.25
module load GCC/4.8.2
./compile.sh
cd ../tensorflow
export PATH=/home/ulg/sysmod/gmath/bazel/output/:$PATH
./configure
bazel build -c opt //tensorflow/tools/pip_package:build_pip_package 2>/dev/null
bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
cd
.local/bin/pip install --user --upgrade /tmp/tensorflow_pkg/tensorflow-0.8.0-py2-none-any.whl
Ottunger
  • 96
  • 2
  • 9
  • Thanks for your answer ;) But the installation is still not successful. I changed the /home/ulg... line to my needs, but I get the following output IOError: [Errno 2] No such file or directory: '/tmp/tensorflow_pkg/tensorflow-0.8.0-py2-none-any.whl' .? Do not know what's going wrong... – jojo123456 Jun 30 '16 at 16:48
  • You need to run this script from your home directory. And to have more output about the error, retry deleting "2>/dev/null" – Ottunger Jul 01 '16 at 06:15