我正在使用Python 3.6.0。我已经使用此命令安装了TensorFlow
pip install tensorflow
pip3 install --upgrade tensorflow
在安装完这些软件包后,我收到了成功消息,但现在我试图在Python空闲状态下执行此代码
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import tensorflow as tf
import sklearn
from glob import glob
import os
print(os.listdir("C:\\Users\\TechProBox\\Desktop\\A_DeviceMotion_data"))
但这给了我以下错误
Traceback (most recent call last):
File "C:\Users\TechProBox\Desktop\python.py", line 4, in <module>
import tensorflow as tf
File "C:\Program Files\Python36\lib\site-packages\tensorflow\__init__.py", line 22, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "C:\Program Files\Python36\lib\site-
packages\tensorflow\python\__init__.py", line 52, in <module>
from tensorflow.core.framework.graph_pb2 import *
File "C:\Program Files\Python36\lib\site-packages\tensorflow\core\framework\graph_pb2.py", line 6, in <module>
from google.protobuf import descriptor as _descriptor
File "C:\Program Files\Python36\lib\site-packages\google\protobuf\descriptor.py", line 47, in <module>
from google.protobuf.pyext import _message
ImportError: DLL load failed: The specified procedure could not be found.
如果我删除了tensorflow导入,那么我会得到所需的输出,就像我需要的
['dws_1', 'dws_11', 'dws_2', 'jog_16', 'jog_9', 'sit_13', 'sit_5', 'std_14', 'std_6', 'ups_12', 'ups_3', 'ups_4', 'wlk_15', 'wlk_7', 'wlk_8']
但是tensorflow导入会出错,这可能是什么原因造成的?这是什么错误,我该怎么办?