Getting Started in Ubuntu - Development Environment

How can I resolve the error ImportError: cannot import name WebSocketApp?

Hereā€™s a working Dockerfile for setting up the mycroft-core development environment, in case thereā€™s any other non-Ubuntu users interested. Itā€™s tested with Fedora 23 as the host OS but should work with Mac OS or any Linux distribution.

FROM ubuntu:14.04

# Add mycroft-core dependencies from build_host_setup.sh and curl
RUN apt-get update
RUN sudo apt-get install -y \
    git \
    python \
    python-dev \
    python-virtualenv \
    python-gobject-dev \
    virtualenvwrapper \
    libtool \
    libffi-dev \
    libssl-dev \
    autoconf \
    bison \
    swig \
    libglib2.0-dev \
    s3cmd \
    portaudio19-dev \
    mpg123 \
    curl

RUN sudo easy_install --upgrade virtualenv

# Get Mycroft Core
RUN git clone https://github.com/MycroftAI/mycroft-core.git

# Make non-root user in container
RUN useradd mycroft -d /mycroft-core && chown -R mycroft /mycroft-core
USER mycroft

# Run dev_setup script as non-root user
WORKDIR mycroft-core
RUN ./dev_setup.sh
2 Likes

Awesome!
Iā€™m going to try this ASAP, thanks!

Great job @Marxau - another community member worked on a Docker file too, but it is still based on the old repo (before we opened up to everyone).

Iā€™ll open it up if you want to head over to it and hit it with a PR.

@Marxau here it is: https://github.com/MycroftAI/docker-mycroft

Letā€™s get it up-to-date! Great work!

I only have time to skim this until I get home, but it looks like the pre-existing dockerfile doesnā€™t use a python virtualenv. I seriously considered going that route (since container in a container is a bit silly) but decided for the sake of guaranteed compatibility and ease of maintenance to keep it.

If you guys think that having virtualenv + docker works Iā€™ll submit the pull request. Otherwise I can tweak the existing dockerfile, but it might occasionally need to be updated if stuff changes w.r.t. the virtualenv settings.

In terms of skills Iā€™m working on a pair of skills for the Wemo smart switch and motion sensor building on the excellent open source Ouimeaux controller project.

1 Like

@Marxau Iā€™m very excited to be able to control Wemo. I think that whatever is best for managing the Docker instance, and making it easy to use is probably the best way to go in regards to Virtualenvs. Iā€™m really going to leave this up to you and @paulscott56ā€™s discretion.

I have Mycroft working just fine on a Raspberry 2 running Raspian Jessie-lite. However, Iā€™m having trouble getting Mycroft to connect to UART. Iā€™ve disabled the login console for the pi using raspi-config. Hereā€™s the error message : EnclosureClient - ERROR - It is not possible to connect to serial port: /dev/ttyAMA0. Is there another process using the serial port that I should be disabling? Iā€™ve already tried stopping getty from using the port but to no avail. Can anyone point me in the right direction? I figured Iā€™d take a stab at creating a custom face display for Mycroft.

Hi Gustavo!

(I thought Iā€™d post this reply to your other thread here.)

First of all, does the /dev/ttyAMA0 UART exist? I assume that it does.

Iā€™ve had to disable getty this way:
sudo systemctl stop serial-getty@ttyAMA0.service sudo systemctl disable serial-getty@ttyAMA0.service

The user that runs the enclosure code should also be a member of the dialout group.
`sudo usermod -aG dialout USERā€™

I hope that helps!

I actually used this last night to build mycroft on centOS 7.3 which is my primary linux distor of choice, due to being a linux admin in Enterprise envs. I just found out that there is now a gnome plugin which is awesome!

I cant run that. how do it?

Here is a video showing exactly how to do this: https://www.patreon.com/posts/mycroft-training-13979749

2 Likes