![](/img/trans.png)
[英]Tensorflow library ImportError: DLL load failed: The specified procedure could not be found
[英]Unable to import tensorflow2.0,(no gpU) ImportError: DLL load failed: The specified procedure could not be found
我正在使用 python 3.6
以下是我面臨的錯誤消息:
Traceback (most recent call last):
File "c:\Users\Vishal\Desktop\tf\new.py", line 1, in <module>
import tensorflow as tf
File "C:\Users\Vishal\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\__init__.py", line 98, in <module>
from tensorflow_core import *
File "C:\Users\Vishal\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow_core\__init__.py", line 40, in <module>
from tensorflow.python.tools import module_util as _module_util
File "C:\Users\Vishal\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\__init__.py", line 50, in __getattr__
module = self._load()
File "C:\Users\Vishal\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\__init__.py", line 44, in _load
module = _importlib.import_module(self.__name__)
File "C:\Users\Vishal\AppData\Local\Programs\Python\Python36\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\Vishal\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow_core\python\__init__.py", line 52, in <module>
from tensorflow.core.framework.graph_pb2 import *
File "C:\Users\Vishal\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow_core\core\framework\graph_pb2.py", line 7, in <module>
from google.protobuf import descriptor as _descriptor
File "C:\Users\Vishal\AppData\Local\Programs\Python\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.
如何解決以上問題?
你確定你已經為正確版本的 pip 安裝了它(也適用於正確版本的 python)?
以下是如何為特定版本的 python(在本例中為 python3)安裝庫的方法:
python3 -m pip install tensorflow
或者您也可以執行以下操作:
pip3 install tensorflow
這取決於您如何配置 python 和 pip。 你如何調用python3.6? 在我的系統中,如果我在命令行中鍵入python3
,它會打開 python3.6 控制台。 您的情況可能有所不同,因此為 pip 和 python 安裝適當版本的庫很重要。
There are ways to check which pip is working with which version of python, one of which is, type pip --version
or pip -V
and it will show you in the output the version of the python it is working for.
例子:
$ pip -V
pip 6.1.1 from /usr/lib/python2.6/site-packages (python 2.6)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.