IoT Azure Edge ContextualVersionConflict: pyOpenSSL

142 views Asked by At

I am following the Quickstart Azure IoT Edge tutorial and in the Section Configure the IoT Edge runtime.

When I configure the runtime with the IoT Edge device connection string

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

(I changed the connection string) I get the following result

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']))

That does not allow me to continue with the command

iotedgectl start

I looked at the file init.py From line 857-859 There is:

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

Lines 848 - 851

 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)

Line 959

needed = self.resolve(parse_requirements(requirements))

What do I need to change there? Or what needs to be configured?

2

There are 2 answers

1
LazarusX On BEST ANSWER

Before installing iotedgectl, you already have a lower version of pyOpenSSL installed, which does not meet iotedgectl's version requirement but precedes the higher version of pyOpenSSL installed along with iotedgectl.

You can check out this answer to learn how to make Python reference the higher version of pyOpenSSL first.

In addition, it seems that you are working on macOS. If so, please refer to Quickstart: Deploy your first IoT Edge module to a Linux or Mac device - preview, instead of Quickstart: Deploy your first IoT Edge module from the Azure portal to a Windows device - preview.

2
Michael Xu On

From the message,it shows that the pyOpenSSL is too old, it needs 0.14 or later.

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']))

You can use the following command to upgrade the pyOpenSSL:

pip install --upgrade pyOpenSSL

If the problem can not be resolved, please feel free to let me know.