How to install Python modules in Microclimate

102 Views Asked by At

I installed Microclimate locally (on macOS) and tried a simple webscraping app. The Microclimate Build was successful but I got a runtime error

k (most recent call last):
  File "app.py", line 4, in <module>
    from bs4 import BeautifulSoup as mySoup
ImportError: No module named 'bs4'

Seems I need to install a module, how would I do this?

Also, what Python version is being used?

1

There are 1 best solutions below

0
On

Microclimate runs your application inside a docker container built using the Dockerfile in the root of your project.

If you created your project from the standard Python template you'll already have a line beginning:

RUN pip install

just add BeautifulSoup4 to the list of modules being installed there and microclimate should rebuild and start your app.

Also the level of python used is defined at the top of that dockerfile. In the default template it is currently Python 3.7