'importing and using a local package
I created a local package.
python setup.py sdist #this created logger.tar.gz
then I create a venv, moved this file to venv, and installed it using the below command.
pip install logger.tar.gz
when I tried to import and use it, the functionality is not working. attaching my code below init.py
#is empty
logger.py
import logging
import os
from logging.handlers import RotatingFileHandler
from logging.handlers import TimedRotatingFileHandler
def loggerInterface(module,flag=None):
<main logic>
return logger
i want to use this package as
from logger import loggerInterface
#use loggerInterface here
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
