Skip to content

Instantly share code, notes, and snippets.

Preface

This article walks you through an example of deploying a Python 3.6 application that uses Pandas and AWS S3 on AWS Lambda using Boto3 in Python in 2018. No shell, no bash, no web console, everything is automated in Python. The previous article of a Hello World example can be found here.

Again, the reason to use Python Boto3 to interact with AWS is that,

  1. I'm more familiar with Python than Bash, which means a Python script can be more flexible and powerful than Bash for me.
  2. I'm not a fun of the AWS web console. It might be easier to do certain things, but it is definitely not automated.

Introduction

@MZuk543
MZuk543 / python_module_import.md
Created January 11, 2024 10:21
About imports from a local python module on Windows using conda

If one wants to import from a python module or a package that is stored or is being developed locally to other local module to have no import problems and not to have to play manually with PATH or PYTHONPATH or deal with absolute/relative import issues one should install it. These are my notes on how to do it successfully on Windows using conda environment.

The problem:

To import local python module to a sibling or a totally different (unrelated) directory.

To set up a drama scene:

There are two modules: module_a and module_b. Both modules are stored locally, but in different, unrelated directories. One wants to import a some_function() from module_a to module_b. The drama takes place on Windows operating system, also a conda environment is to be used.

Solution:

In short: one needs to install module_a locally, in development (editable) mode: pip install -e. To do so: