Paranoid Altoid
Paranoid Altoid

Reputation: 131

Python "No module named 'awsiot'" despite being installed

I've looked up many versions of this problem, I don't think I'm falling for any obvious pitfalls, even using a virtual environment. Starting to wonder if there's something weird with this particular package.

python3 -m venv venv
source venv/bin/activate

pip install awsiot
ls venv/lib/python3.10/site-packages/ | grep awsiot
>>> awsiot-0.1.3.dist-info
python -c "import sys; print(sys.path)"
>>> ['', '/usr/lib/python310.zip', '/usr/lib/python3.10', '/usr/lib/python3.10/lib-dynload', '/home/lexfridman/venv/lib/python3.10/site-packages']

It's installed, it's in a directory that sys.path knows about, in a fresh venv. Yet:

python -c "import awsiot"

>>> Traceback (most recent call last):
>>>   File "<string>", line 1, in <module>
>>> ModuleNotFoundError: No module named 'awsiot'

Same process yields same result on a different linux machine. What could be causing this? Can anyone recreate?

Upvotes: 3

Views: 4721

Answers (1)

Paranoid Altoid
Paranoid Altoid

Reputation: 131

Solution: name in pip install command appears to be different:

pip install awsiotsdk

And now import awsiot works.

Is it normal for these two commands to use different names? I used pipreqs . and pip install -r requirements.txt initially, which makes the same mistake and assumes pip install awsiot is what it needs to do.

Upvotes: 5

Related Questions