Python Forum
geting started with Micropython on ESP 32 - do i need to have a virtual environment?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
geting started with Micropython on ESP 32 - do i need to have a virtual environment?
#1
i am workin on getting started with MicroPython on ESP 32. i have read several postings here and made up my mind - but some questions still remain.

from what i allready have learned it is like so: to get started with micropython development requires several steps

- first building the appropriate binaries for the platform - in my case for the ESP 32.
- second step: Creating A Virtual Environment (- were able to skip that step)
- third step: Setup Project Directory
- finally: installing systems like Debian, Ubuntu, Mint, and variants


so at the very beginning: It is advisable - in the very preliminary steps - to create a virtual environment on the development system -- for me it is a ESP32 - to separate the micropython build system from the local python installation. since this is not absolutly mandatory i have heared that we can skip the virtual environment setup if we are happy to create our build system directly on the host machine.

The next step will to get the Setup of a Project Directory

At this point we will be in our virtual environment. this will set the output of our bash shell. It should show in brackets the name of the active virtual environment like this:

    (microPython) ~/virtalenv/microPython
Now at this point to the setup we should be able to create a project directory to hold our micropython files

    mkdir project cd project
Note: To deactivate the virtual environment we can type deactivate. And to work on the virtual environment after it has been deactivated you

    type: /> source virtalenv/microPython/bin/activate. 
This assumes that we have created the virtual environment with the name

    'micropython'.
Now - were at the point to do some installation of systems like Debian, Ubuntu, Mint, and variants

The following packages that will need to be installed before we can compile and run MicroPython on the system:

Debian, Ubuntu, Mint, and variants
The following packages will need to be installed before i can compile and run MicroPython:
    build-essential
    libreadline-dev
    libffi-dev
    git
    pkg-config (required at least in ubuntu 14.04)
    gcc-arm-none-eabi
    libnewlib-arm-none-eabi
To install these packages, use the following command:
    sudo apt-get install build-essential libreadline-dev libffi-dev git pkg-config gcc-arm-none-eabi libnewlib-arm-none-eabi
Then would have to clone the repository to the local machine, or if i have created a virtual environment clone into the project folder.
    git clone --recurse-submodules https://github.com/micropython/micropython.git
First i would have to check that the mpy-cross script exists to allow cross compiling. This may be fixed at some point in the future to be done automatically but for now you need to do this manually. Change directory to the mpy-cross directory here:
    cd ~/virtalenv/microPython/project/micropython/mpy-cross
question - is it true that i can skip the virtual environment setup? In other words: am i able to create the build system directly on the host machine too?
Wordpress - super toolkits a. http://wpgear.org/ :: und b. https://github.com/miziomon/awesome-wordpress :: Awesome WordPress: A curated list of amazingly awesome WordPress resources and awesome python things https://github.com/vinta/awesome-python
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Help with creating folder and "virtual environment" AudunNilsen 1 171 Mar-21-2024, 04:41 AM
Last Post: deanhystad
  micropython-stepper 1.0.3 trix 2 554 Nov-20-2023, 06:00 AM
Last Post: trix
  Installing python packages in a virtual environment Led_Zeppelin 1 712 Aug-15-2023, 08:18 PM
Last Post: deanhystad
  [ESP32 Micropython]Total noob here, I don't understand why this while loop won't run. wh33t 9 1,635 Feb-28-2023, 07:00 PM
Last Post: buran
  Problem with virtual environment standenman 2 945 Feb-23-2023, 07:09 PM
Last Post: standenman
  Cannot get started standenman 4 1,149 Feb-22-2023, 05:25 PM
Last Post: standenman
Question Virtual Environment (using VS Code) Ashcora 4 12,503 Feb-15-2023, 07:17 PM
Last Post: snippsat
  Need help i just started the whole thing gabriel789 16 3,097 Sep-12-2022, 08:04 PM
Last Post: snippsat
  How do I link the virtual environment of that project to the 3.9.2 version of python? Bryant11 1 1,332 Feb-26-2022, 11:15 AM
Last Post: Larz60+
  Project structure with a virtual environment gdbengo 1 1,390 Jan-26-2022, 03:22 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020