Install

This chapter will explain how to install motorcortex-python.

This chapter will explain how to install mcx-python. Please select the operating system you are u using:


Install Python 3

By default Python 3 should already be installed on your Ubuntu distribution.

If not use your package manager to install python3. On Ubuntu you can use apt in the command line:

sudo apt install python3

Installing Motorcortex-Python

Motorcortex-python can be installed by using the pip tool.

  1. To be able to use pip to install python packages this first needs to be installed:

    sudo apt install python3-pip
    
  2. Then download, build and install the motorcortex-python package via pip.

    sudo -H pip3 install motorcortex-python
    
  3. Congratulations Motorcortex-python is now installed

Install Virtual Environment

Motorcortex-python can also be installed inside a virtual environment. This can be useful if your system has a different python environment than the one required for Motorcortex or if you would like to keep the Motorcortex-python tools separate from the rest of the system for security reasons. A Virtual Environment, is an isolated working copy of Python which allows you to work on a specific project without worry of affecting other projects.

Installing Virtualenv

  1. Check if virtual environment is already installed on your system you can check this using the following command:

    virtualenv --version
    
  2. If you see a version number for instance 1.6.1 it is already installed. If not you will have to install Vitrualenv:

    sudo apt-get install virtualenv
    

Setting up Vitrualenv

  1. You will need a directory for your virtual enviroment. You may choose any location you desire:

    mkdir ~/virtualenvironment
    
  2. To create a folder for your new app that includes a clean copy of Python3 run:

    virtualenv -p python3 ~/virtualenvironment/mcx-env
    
  3. We have created this new folder called mcx-env. To begin cd into your new project:

    cd ~/virtualenvironment/mcx-env/bin
    
  4. Now you are in your virtual environment folder you can activate your virtual environment:

    source activate
    
  5. Notice your prompt will have a shell in this case (mcx-env). If you would like to leave your virtual environment type the following command:

    deactivate
    

Installing Motorcotex-Python in Vitrualenv

  1. Motorcortex-python can be installed by using the “pip” tool. download, build and install the motorcortex-python package via pip.

    pip3 install motorcortex-python
    
  2. Congratulations Motorcortex-python is now installed in your virtual environment.


Install Python 3.7 or lower

Download Python 3 from the python website: https://www.python.org/downloads/windows/. Choose the appropriate installer for your system. Make sure you choose Python 3.7.

  1. Launch the installer and choose Customize installation.

    image not found
  2. All options are selected by default (documentation and test suite are actually optional) Click Next.

    image not found
  3. Under the Advanced Options select Add Python to environment variables.

    image not found
  4. Click Install.

  5. Congratulations Python 3 is now installed.

Installing Motorcortex-Python

Motorcortex-python is the core library required for any Motorcortex application. It provides convenient ways to communicate with Motorcortex-based applications.

Motorcortex-python can be installed by using the “pip” tool. You have to be connected to the internet to install packaged using pip.

  1. Open a Command Prompt by pressing the Windows key and typing “cmd”.
  1. In the Command Prompt window type:
python -m pip install Motorcortex-python
  1. Congratulations motorcortex-python package is now installed for the current user.

Alternative Installation Instructions

Alternatively the user can use the miniconda package management and environment management system.

Install Miniconda Python3

Download Miniconda Python 3 from the Conda website: https://docs.conda.io/en/latest/miniconda.html. Choose the appropriate installer for your system.

  1. Launch the installer.

  2. Click Next.

    image not found
  3. Click I Agree.

    image not found
  4. Select for who the installation is designated and click Next.

    image not found
  5. Choose your desired destination folder and click Next.

    image not found
  6. Select Register Anaconda as my default Python --

    image not found
  7. Click Install to start the installation.

  8. Click Finish to finish the installation.

    image not found

Create environment

Open an Anaconda Prompt by pressing the windows key, type anaconda in the search field and select appropriate.

  1. In the Anaconda Prompt window, to create the mcx-env environment, type:
conda create -n mcx-env python=3.7
image not found

To remove an environment use ”conda env remove -n

ENV_NAME

Activate environment

Activate the environment:

conda activate mcx-env

image not found

Make sure to check out the Examples or Tools. For creating your own Motorcortex-Python Application.