diff --git a/Getting-Started.md b/Getting-Started.md index d801e9c..cfd9758 100644 --- a/Getting-Started.md +++ b/Getting-Started.md @@ -1,5 +1,41 @@ Getting started with micropython development requires first building the appropriate binaries for your platform. +It is advisable to create a virtual environment on your system to separate your micropython build system from your local python installation. This is not mandatory, so skip the virtual environment setup if you are happy to create your build system directly on your host machine. + +## Creating A Virtual Environment + +To setup a virtual environment you first need **virtualenv** installed on your machine. [Go to here](https://gist.github.com/frfahim/73c0fad6350332cef7a653bcd762f08d) to find instructions on how to set this up. + +Once you have installed virtualenv, create a private virtual environment so that our build process which uses python scripts will not be influenced by python modules and libraries that a user may typically download and install on their root machine. + +```bash +/> mkvirtualenv --python=/usr/bin/python3 microPython + +Already using interpreter /usr/bin/python3 +Using base prefix '/usr' +New python executable in /home//virtalenv/microPython/bin/python3 +Also creating executable in /home//virtalenv/microPython/bin/python +Installing setuptools, pkg_resources, pip, wheel...done. +``` +The mkvirtualenv command creates an area within your file system for your project files and updates environment variables to point to a local installation of a new python environment. The command **--python=/usr/bin/python3** tells virtualenv to use Python3 files. The **microPython**keyword is the name of the virtual environment. + +### Setup Project Directory +Now you will be in your virtual environment. You know this from the output of your bash shell. It should show in brackets the name of the active virtual environment like this: + +```bash +(microPython) ~/virtalenv/microPython +``` +Now create a project directory to hold micropython files + +```bash +/> mkdir project +/> cd project +``` + +**Note** To deactivate your virtual environment you can type **deactivate** And to work on your virtual environment if you have deactivated it you type: **/> workon microPython**. This assumes that you created your virtual environment with the name 'micropython'. + + + ## UNIX * [DEB-based systems](https://github.com/micropython/micropython/wiki/Getting-Started#debian-ubuntu-mint-and-variants) * [FreeBSD-based systems](https://github.com/micropython/micropython/wiki/Getting-Started#freebsd)