Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip install azure-iot-hub succeeds, but 'iot' folder does not exist #13

Open
TiboVZ-r opened this issue Feb 8, 2024 · 2 comments
Open

Comments

@TiboVZ-r
Copy link

TiboVZ-r commented Feb 8, 2024

On a Beaglebone Black, I want to run some python code making use of this package.
The device is on Debian 11. Using python 3.9
Virtual environment is selected with source activate.

After running pip install azure-iot-hub or pip3 ..., the install process looks as normal.
Yet python code fails to run when trying to import the modules from azure.iot.hub.

When taking a look at venv/lib/pyhton3.9/site-packages/azure, "iot" folder does not exist.
After searching online, it popped up several times. People suggested to build the wheel locally.
This is not a good idea since the beaglebone has really limited hardware.

We can download the "wheel" on pypi.
When I do pip install ...whl, it gives the same behaviour.

Yet when I just unzip and copy the 'iot' folder to venv/lib/pyhton3.9/site-packages/azure/, everything works as expected.
This is not a good way since it requires manual action and is hard to automate in pipelines. (in comparison to requirements file)

Is this expected behavior for armv7? Should this work or is just doing "pip3 install azure-iot-hub" wrong?

@manszigher
Copy link

manszigher commented Nov 25, 2024

I had to update the setup.py in the azure-iot-hub to get it installed. The setup.py for azure-iot-hub is explicitly excluding the azure folder. Don't understand why. I am using yocto for building for my target and could not find any recipe for the azure-iot-hub so I had to create my own and to get it to work I had to patch the setup.py. To be honest not sure if the azure-iot-hub module should actually be running on the device or if it is more for management and is more for a backend or application. Anyway once I got the setup.py patched I got it installed but then I got other dependencies issues that was missing so currently I have still not been able to get a fully working azure-iot-hub stack working on my target. I have no problem getting azure-iot-device working so that is why I am second guessing if the idea is to really have azure-iot-hub running on the device. You can find the setup.py at

https://github.com/Azure/azure-iot-hub-python/blob/main/setup.py#L87

@AndreRicardo-Zoetis
Copy link

Are you sure you want to use this library in your device and not the SDK library?

Microsoft documentation:
https://learn.microsoft.com/en-us/azure/iot/iot-sdks#device-sdks

GitHub:
https://github.com/Azure/azure-iot-sdk-python/

Pip package:
https://pypi.org/project/azure-iot-device/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants