python - 面临导入错误: DLL load failed while implementing Microsoft azure iothub_service_client

标签 python c++ node.js azure dll

我正在尝试开发一个使用 Microsoft azure 实现 IoT 的 python 控制台应用程序。为此,我关注very basic tutorial made for python developers by Microsoft azure在我的 Windows 10 计算机上。预装Visual C++ redistributable package是本教程简介部分中描述的 4 个先决条件中允许使用 Python 原生 DLL 的最重要要求之一。

我的系统配置:

Software                               Version
-------------------------------------------------------
Python:                                3.5.2
Visual C++ redistributable package:    2010, 2013, 2017
Node:                                  6.10.2

Visual C++ 可再发行组件包图: enter image description here

问题:

  1. Visual C++ redistributable package 起未安装 Visual C++ 可再发行组件包教程中是旧版本(2015),然后是我的版本(2017)。
  2. 它显示以下错误:

    Traceback (most recent call last):
      File "CreateDeviceIdentity.py", line 2, in <module>
        import iothub_service_client
      File "F:\Settings\Windows\ProgramFiles\Python\lib\site-packages\iothub_service_client\__init__.py", line 1, in <module>
        from .iothub_service_client import *
    ImportError: DLL load failed: The specified module could not be found.
    

问题:

  1. 我该如何解决这个问题?

注意:我已经完成了为 JavaNodeJS 开发人员提供的基础教程。

最佳答案

我尝试成功重现您的问题,并且我使代码 import iothub_service_client 在安装后有效 Visual C++ Redistributable for Visual Studio 2015 。所以请在你的机器上安装2015版本来解决它,正如教程所说,

If you are using Windows OS, then Visual C++ redistributable package to allow the use of native DLLs from Python.

教程中的链接适用于 2015 版本。

关于python - 面临导入错误: DLL load failed while implementing Microsoft azure iothub_service_client,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44712900/

相关文章:

python - 从文件中读取变量主机名

python - tweepy 错误响应状态代码 400

python - 带有 OR 语句的 Django 过滤器

c++ - 防止对不同大小的、模板化的、多态的、数学 vector 进行组件操作

C++:跟踪调用函数的时间

c++ - 计算一个int在一个文件中出现的次数

javascript - [Electron][OSX] 始终显示托盘图标

python - 在新文件目录时运行 bash 脚本?

javascript - 使用 Express 更改文件夹或文件类型中的文件的 http header ?

javascript - nodejs 在文件上传时抛出 ENOENT 错误