Mycroft Community Forum

Import python library into a skill

Hello,

I tried to import an external library into a new skill but I get the error ‘no module named “xxxxx”’ even though I installed it trough ‘pip3 install’. And if I run a python3 cli I can import it.
Do I have to install the library somewhere else?
Thank you.

Mycroft has everything installed in it’s own virtual environment, so you need;

mycroft-pip install …

2 Likes

Thank you, I missed that one…I have still a lot of things to discover !

2 Likes

Hi babbel,

Also make sure to add this into your Skills dependencies so it is automatically installed when other users install your Skill. More details here:
https://mycroft-ai.gitbook.io/docs/skill-development/dependencies

I should also add in a section about the Mycroft virtual environment and manually installing packages. I don’t think that is actually documented, so no surprise that you didn’t know about it!