Skip to content

AWSIoT Custom Component Dependencies w/Greengrass

0

I recently had to change permissions for how my custom component runs. It needed root so I added 'RequiresPrivilege to my recipe in the right places -- worked fine.

However, now that it is root it goes through python dependencies (custom component = python)

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.. awscli 2.9.19 requires awscrt<0.17.0,>=0.12.4, but you have awscrt 0.21.1 which is incompatible.. awscli 2.9.19 requires distro<1.6.0,>=1.5.0, but you have distro 1.8.0 which is incompatible.. awscli 2.9.19 requires prompt-toolkit<3.0.29,>=3.0.24, but you have prompt-toolkit 3.0.36 which is incompatible

Successfully installed awscrt-0.21.1 awsiotsdk-1.22.0 scapy-2.6.1

So should I be worried here? Or, should I make the dependencies the install is calling out part of my requirements.txt?

asked a year ago97 views
1 Answer
2

The situation you're describing is a common issue when dealing with Python dependencies in AWS IoT Greengrass custom components. While the errors you're seeing might seem concerning, they don't necessarily indicate a critical problem that will prevent your component from functioning.

The error messages you're seeing are primarily related to version conflicts between the AWS CLI (awscli) and some of its dependencies. However, your custom component is likely not directly using the AWS CLI, so these conflicts may not affect your component's operation.

That being said, it's generally a good practice to manage your dependencies carefully to avoid potential issues. Here are a few recommendations:

  1. Include the specific versions of the libraries your component needs in your requirements.txt file. This helps ensure that your component uses the versions it was developed and tested with.

  2. Consider using virtual environments or containerization for your component to isolate its dependencies from the system-wide Python packages.

  3. If you're using AWS IoT Device SDK (awsiotsdk) in your component, which seems to be the case based on the "Successfully installed" message, make sure to specify the version you need in your requirements.txt.

  4. For the other successfully installed packages (like scapy), if your component relies on them, include them in your requirements.txt as well.

  5. If you're not using awscli in your component, you might want to consider excluding it from your component's environment to avoid these conflicts.

Remember, when your component runs as root, it has access to system-wide Python packages, which can lead to these kinds of conflicts. By carefully managing your component's dependencies and potentially isolating its environment, you can minimize these issues.

If your component is working as expected despite these messages, you may not need to take immediate action. However, it's worth keeping an eye on your component's behavior and logs to ensure these conflicts don't cause problems in the future.

Sources
Using my own python package in different greengrass components | AWS re:Post
Deploy AWS IoT Greengrass components to devices - AWS IoT Greengrass

answered a year ago
AWS
EXPERT
reviewed 9 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.