Python 在pycharm中运行tensorflow时出错

Python 在pycharm中运行tensorflow时出错,python,tensorflow,pycharm,Python,Tensorflow,Pycharm,我是pycharm、tensorflow和python的新手。我有一个简单的程序: import tensorflow as tf hello = tf.constant('Hello, TensorFlow!') sess = tf.Session() print(sess.run(hello)) 要设置tensorflow模块,我遵循以下步骤:settings>selecte'addlocal'>selected/home/manish/dev/tensorflow/bin/python3

我是pycharm、tensorflow和python的新手。我有一个简单的程序:

import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
要设置tensorflow模块,我遵循以下步骤:
settings>selecte'addlocal'>selected/home/manish/dev/tensorflow/bin/python3.4
。我的tensorflow安装在
/home/manish/dev/tensorflow/

我得到这个错误:

/home/manish/dev/tensorflow/bin/python3.4 /home/manish/PycharmProjects/untitled/test.py
Traceback (most recent call last):
  File "/home/manish/dev/tensorflow/lib/python3.4/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/home/manish/dev/tensorflow/lib/python3.4/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/home/manish/dev/tensorflow/lib/python3.4/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "/home/manish/dev/tensorflow/lib/python3.4/imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
ImportError: libcublas.so.8.0: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/manish/PycharmProjects/untitled/test.py", line 1, in <module>
    import tensorflow as tf
  File "/home/manish/dev/tensorflow/lib/python3.4/site-packages/tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import *
  File "/home/manish/dev/tensorflow/lib/python3.4/site-packages/tensorflow/python/__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/home/manish/dev/tensorflow/lib/python3.4/site-packages/tensorflow/python/pywrap_tensorflow.py", line 72, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "/home/manish/dev/tensorflow/lib/python3.4/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/home/manish/dev/tensorflow/lib/python3.4/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/home/manish/dev/tensorflow/lib/python3.4/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "/home/manish/dev/tensorflow/lib/python3.4/imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
ImportError: libcublas.so.8.0: cannot open shared object file: No such file or directory


Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/install_sources#common_installation_problems

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
/home/manish/dev/tensorflow/bin/python3.4/home/manish/PycharmProjects/untitled/test.py
回溯(最近一次呼叫最后一次):
文件“/home/manish/dev/tensorflow/lib/python3.4/site packages/tensorflow/python/pywrap\u tensorflow.py”,第58行,在
从tensorflow.python.pywrap\u tensorflow\u内部导入*
文件“/home/manish/dev/tensorflow/lib/python3.4/site packages/tensorflow/python/pywrap\u tensorflow\u internal.py”,第28行
_pywrap\u tensorflow\u internal=swig\u import\u helper()
swig\u import\u helper中的文件“/home/manish/dev/tensorflow/lib/python3.4/site packages/tensorflow/python/pywrap\u tensorflow\u internal.py”,第24行
_mod=imp.load_模块(“pywrap_tensorflow_internal”,fp,路径名,描述)
文件“/home/manish/dev/tensorflow/lib/python3.4/imp.py”,第243行,在加载模块中
返回加载动态(名称、文件名、文件)
ImportError:libcublas.so.8.0:无法打开共享对象文件:没有此类文件或目录
在处理上述异常期间,发生了另一个异常:
回溯(最近一次呼叫最后一次):
文件“/home/manish/PycharmProjects/untitled/test.py”,第1行,在
导入tensorflow作为tf
文件“/home/manish/dev/tensorflow/lib/python3.4/site packages/tensorflow/_init__.py”,第24行,在
从tensorflow.python导入*
文件“/home/manish/dev/tensorflow/lib/python3.4/site packages/tensorflow/python/__init__;.py”,第49行,在
从tensorflow.python导入pywrap\u tensorflow
文件“/home/manish/dev/tensorflow/lib/python3.4/site packages/tensorflow/python/pywrap\u tensorflow.py”,第72行,在
提高效率(msg)
ImportError:回溯(最近一次呼叫上次):
文件“/home/manish/dev/tensorflow/lib/python3.4/site packages/tensorflow/python/pywrap\u tensorflow.py”,第58行,在
从tensorflow.python.pywrap\u tensorflow\u内部导入*
文件“/home/manish/dev/tensorflow/lib/python3.4/site packages/tensorflow/python/pywrap\u tensorflow\u internal.py”,第28行
_pywrap\u tensorflow\u internal=swig\u import\u helper()
swig\u import\u helper中的文件“/home/manish/dev/tensorflow/lib/python3.4/site packages/tensorflow/python/pywrap\u tensorflow\u internal.py”,第24行
_mod=imp.load_模块(“pywrap_tensorflow_internal”,fp,路径名,描述)
文件“/home/manish/dev/tensorflow/lib/python3.4/imp.py”,第243行,在加载模块中
返回加载动态(名称、文件名、文件)
ImportError:libcublas.so.8.0:无法打开共享对象文件:没有此类文件或目录
未能加载本机TensorFlow运行时。
看见https://www.tensorflow.org/install/install_sources#common_installation_problems
因为一些常见的原因和解决方案。包括整个堆栈跟踪
以上是请求帮助时的错误消息。
进程已完成,退出代码为1

通过终端而不是搜索栏打开Pycharm

  • 开放式终端
  • 执行命令:pycharm社区

  • 通过终端而不是搜索栏打开Pycharm

  • 开放式终端
  • 执行命令:pycharm社区

  • 我遇到了同样的问题,我可以从终端执行脚本,但不能从pycharm执行。我遇到了同样的问题,我可以从终端执行脚本,但不能从pycharm执行。