Answer the question
In order to leave comments, you need to log in
How to pull boto3 package from local directory?
Hello everyone,
I'm writing a Lambda function for aws, installed the boto3 package for it. Now in my main python file (main.py) is:
import boto3
import os
from pprint import pprint
import time
...............................
Answer the question
In order to leave comments, you need to log in
Here it works:
>>> import sys
>>> sys.path.insert(0, 'packages')
>>> from packages import boto3
I don't know if these options work for you.
For example, I have a testpackage folder in the project root folder, a subtestpackage folder in it, a subtestmodule.py file in it, functions and classes in it.
You can either use them like this:
from testpackage.subtestpackage.subtestmodule import subtestfunc, Subtestclass, anotherfunc
a = subtestfunc()
b = Subtestclass()
c = anotherfunc()
from testpackage.subtestpackage import subtestmodule as sm
a = sm.subtestfunc()
b = sm.Subtestclass()
c = sm.anotherfunc()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question