title: PyCharm remote interpreter and Tensorflow -> can not import Cudart.so
body: <p>I'm using PyCharm for remote debugging, client Win10, server Ubuntu 16. On the Ubuntu machine I have Cuda 8.0 correctly installed, along with python 2.7 and tensorflow 1.0.0. Tensorflow works perfectly from the server (ssh + invoking python, import tensorflow etc..).</p>
  
  <p>In PyCharm I set up a remote debugger to my server machine, but now importing tensorflow results in an error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "/home/*****/*****/********/*******.py", line 24, in &lt;module&gt;
      import tensorflow as tf
    File "/usr/local/lib/python2.7/dist-packages/tensorflow/__init__.py", line 24, in &lt;module&gt;
      from tensorflow.python import *
    File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/__init__.py", line 60, in &lt;module&gt;
      raise ImportError(msg)
  ImportError: Traceback (most recent call last):
    File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/__init__.py", line 49, in &lt;module&gt;
      from tensorflow.python import pywrap_tensorflow
    File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 28, in &lt;module&gt;
      _pywrap_tensorflow = swig_import_helper()
    File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 24, in swig_import_helper
      _mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description)
  ImportError: libcudart.so.8.0: cannot open shared object file: No such file or directory
  
  
  Error importing tensorflow.  Unless you are using bazel,
  you should not try to import tensorflow from its source directory;
  please exit the tensorflow source tree, and relaunch your python interpreter
  from there.
  </code></pre>
  
  <p>I tried:</p>
  
  <p>adding the correct paths to the sys.path variable</p>
  
  <p>adding LD_LIBRARY_PATH to os.environ and/or to the PyCharm environment variables</p>
  
  <p>No success!</p>
  
  <p>I recall time ago I was able to do debugging without any problem, but I can't figure out what's wrong. Any suggestion?</p>
  
  <p><strong>UPDATE 1</strong>
  After rebooting, the error changed to this</p>
  
  <pre><code>ssh://****@192.168.***.***:22/usr/bin/python -u /home/*****/.pycharm_helpers/pydev/pydevd.py --multiproc --qt-support --client '0.0.0.0' --port 35523 --file /home/*/*/*/*/test.py
  warning: Debugger speedups using cython not found. Run '"/usr/bin/python" "/home/*/.pycharm_helpers/pydev/setup_cython.py" build_ext --inplace' to build.
  pydev debugger: process 1913 is connecting
  
  Connected to pydev debugger (build 163.10154.50)
  Traceback (most recent call last):
    File "/home/*/.pycharm_helpers/pydev/pydevd.py", line 1596, in &lt;module&gt;
      globals = debugger.run(setup['file'], None, None, is_module)
    File "/home/*/.pycharm_helpers/pydev/pydevd.py", line 974, in run
      pydev_imports.execfile(file, globals, locals)  # execute the script
    File "/home/*/*/*/*/test.py", line 1, in &lt;module&gt;
      import tensorflow
    File "/usr/local/lib/python2.7/dist-packages/tensorflow/__init__.py", line 24, in &lt;module&gt;
      from tensorflow.python import *
    File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/__init__.py", line 72, in &lt;module&gt;
      raise ImportError(msg)
  ImportError: Traceback (most recent call last):
    File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/__init__.py", line 61, in &lt;module&gt;
      from tensorflow.python import pywrap_tensorflow
    File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 28, in &lt;module&gt;
      _pywrap_tensorflow = swig_import_helper()
    File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 24, in swig_import_helper
      _mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description)
  ImportError: libcudart.so.8.0: cannot open shared object file: No such file or directory
  
  
  Failed to load the native TensorFlow runtime.
  
  See https://github.com/tensorflow/tensorflow/blob/master/tensorflow/g3doc/get_started/os_setup.md#import_error
  
  for some common reasons and solutions.  Include the entire stack trace
  above this error message when asking for help.
  
  Process finished with exit code 1
  </code></pre>
  
  <p><strong>UPDATE 2 / SOLVED</strong>
  As I tried before, the solution was to add on pycharm the LD_LIBRARY_PATH to the environment variables on the configuration panel. I think before it didn't work for a blank space after the name (-> 'LD_LIBRARY_PATH '). Here the solution:
  <a href="https://i.stack.imgur.com/gBPer.png" rel="noreferrer">solution</a></p>