物联网Azure Edge ContextualVersionConflict:pyOpenSSL

时间:2018-05-06 10:40:33

标签: azure-iot-edge azure-iot-suite

我正在关注快速入门Azure IoT Edge 教程和第Configure the IoT Edge runtime部分。

使用IoT Edge设备连接字符串配置运行时

dataLayerBPush = dataLayerB.push;

dataLayerB.push = function(obj) {
  dataLayerBPush(obj);
  dataLayerA.push(obj);
}

(我更改了连接字符串)我得到以下结果

iotedgectl setup --connection-string "{device connection string}" --nopass

这不允许我继续使用命令

Traceback (most recent call last):
  File "/usr/local/bin/iotedgectl", line 11, in <module>
    sys.exit(coremain())
  File "/Library/Python/2.7/site-packages/edgectl/__init__.py", line 23, in coremain
    version = pkg_resources.require(PACKAGE_NAME)[0].version
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 959, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 851, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (pyOpenSSL 0.13.1 (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python), Requirement.parse('pyOpenSSL>=0.14'), set(['docker']))

我查看了文件 init .py 从第857-859行有:

iotedgectl start

第848行 - 第851行

        # Register the new requirements needed by req
        for new_requirement in new_requirements:
            required_by[new_requirement].add(req.project_name)

第959行

 if dist not in req:
                # Oops, the "best" so far conflicts with a dependency
                dependent_req = required_by[req]
                raise VersionConflict(dist, req).with_context(dependent_req)

我需要更改什么?或者需要配置什么?

2 个答案:

答案 0 :(得分:1)

从消息中可以看出pyOpenSSL太旧了,需要0.14或更高版本。

Traceback (most recent call last):
  File "/usr/local/bin/iotedgectl", line 11, in <module>
    sys.exit(coremain())
  File "/Library/Python/2.7/site-packages/edgectl/__init__.py", line 23, in coremain
    version = pkg_resources.require(PACKAGE_NAME)[0].version
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py",
 line 959, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py",
 line 851, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (pyOpenSSL 0.13.1 (/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python),
 Requirement.parse('pyOpenSSL>=0.14'), set(['docker']))

您可以使用以下命令升级pyOpenSSL:

pip install --upgrade pyOpenSSL

如果问题无法解决,请随时告诉我。

答案 1 :(得分:1)

在安装iotedgectl之前,你已经安装了较低版本的pyOpenSSL,它不符合iotedgectl的版本要求,但在更高版本的pyOpenSSL和iotedgectl之前安装。

您可以查看this answer以了解如何让Python首先引用更高版本的pyOpenSSL。

此外,您似乎正在使用macOS。如果是,请参阅Quickstart: Deploy your first IoT Edge module to a Linux or Mac device - preview,而不是Quickstart: Deploy your first IoT Edge module from the Azure portal to a Windows device - preview