Tensorflow and Pycharm
The solution is:

Run PyCharm from the console.
OR
add the environment variable to the IDE settings: LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
I have an issues with tensorflow on pycharm.
Whenever I import tensorflow in the linux terminal, it works correctly. However, in PyCharm community 2017.1, it shows:
ImportError: libcudnn.so.5: cannot open shared object file: No such file or directory
Any hint on how to tackle the issue.
Please note that I am using python 3.5.2, tensorflow 1.1.0, Cuda 8 and CuDnn 5.1
EDIT: when printing sys.path, I get this in PyCharm:
['/home/xxx/pycharm-community-2017.1.2/helpers/pydev', '/home/xxx/pycharm-community-2017.1.2/helpers/pydev', '/usr/lib/python35.zip', '/usr/lib/python3.5', '/usr/lib/python3.5/plat-x86_64-linux-gnu', '/usr/lib/python3.5/lib-dynload', '/usr/local/lib/python3.5/dist-packages', '/usr/lib/python3/dist-packages', '/usr/local/lib/python3.5/dist-packages/IPython/extensions', '/home/xxx/xxx/xxx']
and this in the terminal:
['', '/usr/local/bin', '/usr/lib/python35.zip', '/usr/lib/python3.5', '/usr/lib/python3.5/plat-x86_64-linux-gnu', '/usr/lib/python3.5/lib-dynload', '/usr/local/lib/python3.5/dist-packages', '/usr/lib/python3/dist-packages', '/usr/local/lib/python3.5/dist-packages/IPython/extensions', '/home/xxx/.ipython']