我在linux上安裝了virtualenv的tensorflow。有sitepackage文件夾下的tensorflow包,但是當我運行從Github上下載的演示,它表明:ImportError:沒有名爲tensorflow的模塊,但tensorflow確實存在
(tensorflow) [email protected]:~/tensorflow$ sudo python CNN_sentence_tensorflow-master/sentence_classfier_with_tensorflow.py
Traceback (most recent call last):
File "CNN_sentence_tensorflowmaster/sentence_classfier_with_tensorflow.py", line 13, in <module>
import tensorflow as tf
ImportError: No module named tensorflow
我這樣做的接口。這是確定:
(tensorflow) [email protected]:~/tensorflow/multi-class-text-classification-cnn-master$ python
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> import tensorflow as tf
>>>
我真的很感謝你的幫助! –
@ X.Zoe如果有幫助,請接受這個答案。 – McGrady
好的,但我仍然有一個問題,那就是如果我確實需要寫入一些文件的權限。我怎樣才能獲得這個用戶沒有的權限? –